Thread: 301 Redirects
View Single Post
Old 2010-08-15, 06:52 AM   #2
Simon
That which does not kill us, will try, try again.
 
Simon's Avatar
 
Join Date: Aug 2003
Location: Conch Republic
Posts: 5,150
Send a message via ICQ to Simon Send a message via AIM to Simon Send a message via Yahoo to Simon
Regarding redirecting index.html to the root, it'll be best to specify the page which will be the root index page instead of index.html or you could wind up creating the conditions for an endless loop that you don't want. For example...

redirect 301 /index.html http://www.yourdomain.com/index.php

I'm not sure how to redirect a page or directory that doesn't exist.
Usually that's the job of the 404* redirect, not done by a 301 permanent replacement directive. For example...

ErrorDocument 404 /index.php

Both of those lines go in your .htaccess file. Make sure there's one space where shown, and that you use either relative or complete urls as shown in each instance. I'm just assuming index.php is your new index page so use whatever is correct in your case, but make sure to use the complete url.

Added: If you watch your server's error log for specific pages that get handled with a 404 you can add those to your .htaccess file using 301s in order to capture the PR of those missing pages and pass it along to wherever you redirect via 301 (if you believe it works that way). You can ignore the misspelled urls which get 404s of course.
__________________
"If you're happy and you know it, think again." -- Guru Pitka

Last edited by Simon; 2010-08-15 at 07:06 AM.. Reason: forgot to mention looking at the error log
Simon is offline   Reply With Quote