ErrorDocument in .htaccess Returns 302 Response
October 15th, 2007Just thought I would help out anybody who has this same problem. When using a custom error page to hand 404 errors, you need to make sure you use the local path to the script and not a full URL, otherwise the server needs to use a redirect to get to the page. This will cause a message from Google Webmaster Tools such as "We've detected that your server returns a status of 200 (found successfully) for pages that don't exist. "
So, this line in your .htaccess is the WRONG way:
ErrorDocument 404 http://www.micahcarrick.com/404.phpAnd this would be correct:
ErrorDocument 404 /404.php
This is easy to test for if you have curl installed on your system using:
curl --header http://www.micahcarrick.com/this-doesnt-exist.html
The right way returns 404, the wrong way returns 302.
Categories
Popular Posts
RSS Feeds
Archives
December 17th, 2007 at 8:10 am
Thanks!