ErrorDocument in .htaccess Returns 302 Response
October 15, 2007
Just 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.php
And this would be correct:
ErrorDocument 404 /404.phpThis is easy to test for if you have curl installed on your system using:
curl --header http://www.micahcarrick.com/this-doesnt-exist.htmlThe right way returns 404, the wrong way returns 302.
Categories:
Web Development
Copyright © 2004 - 2010 Micah Carrick. All Rights Reserved.
2 Comments about "ErrorDocument in .htaccess Returns 302 Response"
RSS Feed
Leave a Comment about "ErrorDocument in .htaccess Returns 302 Response"