Friday, September 22, 2006

301 Redirects

There are thousands of these posts out there already - I'm putting this here for my benefit more than anything else. Saves me from having to Google when I need to check how it should be done!

So - if you move a page and want it to be followed by a search engine (and keep it's pagerank etc), open up your htaccess file and enter (all on one line):

redirect 301 /olddir/oldpage.html http://www.newsite.com.au/newdir/newpage.html

Or if you're shifting a whole directory (again, all on one line):

redirect 301 /olddir/ http://www.newsite.com.au/newdir/

The 301 code says "moved permanently", so don't use it for temporary redirections. Obviously this htaccess stuff is for linux servers, if you're on Windows then there's a different way... But you'll have to find that somewhere else!

No comments:

Post a Comment