Redirects for old URLs

ptone

New member
I noticed that after the website update, a bookmarked URL for the electrovibe build doc is landing on a 404. You might want to consider adding 301 redirects for any old URLs that have changed. This would be helpful for users and for SEO!

You can add redirects for each page in your .htaccess file (assuming it's on an apache server) with mod_rewrite:

<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
RedirectMatch 301 https://www.pedalpcb.com/docs/ElectroVibe-PedalPCB.pdf https://docs.pedalpcb.com/project/ElectroVibe-PedalPCB.pdf

Or, you can do it with a rewrite condition for the entire subdirectory:
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
RewriteBase /
RewriteRule ^/docs/(.*)$ http://docs.pedalpcb.com/$1 [R=301,L]

If it's on an nginx server, this would go in your nginx.conf file or virtual host file in sites-available
location ^~ /docs {
rewrite ^/docs/?(.*)$ https://docs.pedalpcb.com/$1 permanent;
}

after you make this kind of change, be sure to restart apache or nginx. If it's in nginx, be sure to run nginx -t to make sure there are no errors before restarting nginx

Cheers!
 
Good point.

The docs were scattered a bit, so it wasn't quite so cut and dry. I updated as many links as possible but some were in odd locations so it wasn't quite so easy.

The reason for the move was specifically to get things a bit more organized.

I'll set up a rewrite for the bulk of them though, good call.
 
You could post a “Keep Out” sign. That might cut down on bandwidth…then again, so would banning me so yeah, good call!
 
Back
Top