Error handling for news directory
The URL puppylinux.com/news/ used to have a Simplephpblog blog in it, and I see from the access and error logs that there are many attempts to access entries in the non-existent blog.So, I created a news/.htaccess file with an 'ErrorDocument' entry to redirect all '404' server errors (file not found) to puppylinux.com/news/index.html
To test, go to this randomURL:
http://puppylinux.com/news/viewtopic.php?page=66
The thing is though, will search engines then know the the invalid URL is in fact invalid, and stop using it?
UPDATE:
I've done the same for the 'blog' directory. This directory used to have a WordPress blog in it when I was hosted on servage, so there could be invalid page accesses in here too. In this case the redirection is to my new blog front page.
Comments:
Posted on 13 Apr 2008, 7:19 by hairywillissue a 301 using htaccess
In this situation you should serve an http 301 error message that tells the user agent where the page has been permanently been moved to. This link contains instructions on how to do this using htaccess. I cannot vouch for its accuracy as it is not something I have ever tried.
http://www.askapache.com/htaccess/seo-search-engine-friendly-redirects-without-mod_rewrite.html#seo-301-redirect-single-file