Why does my custom 404 page return a HTTP 200 OK status message?
Q: I am currently trapping all 404 page not founds to the index page of my site through a line in my .htaccess which says
ErrorDocument 404 http://www.domain.com
This works in that all "page not found" errors are redirected to my home page, however I've just noticed that the HTTP status message returned is 200 (OK). Does this mean that the search engines may feel that the pages are duplicates?
A: This problem is caused by one of the most common errors in defining ErrorDocument:
To do what you want your htaccess directive should really read:
ErrorDocument 404 /
This redirects 404 errors to the home page, as defined by your apache configuration. When the ErrorDocument 404 directive is used with a local-URL path, the correct server status code will be returned. When used with a full URL, a redirect is performed, with the browser first receiving a 302 (page temporarily moved ) redirect. The browser then fetches the URL given in the 302 response, and finally sees a 200-OK status.
This response code behaviour is clearly described in the documentation for the ErrorDocument directive on the apache website.
However, I believe that the best practice for error pages is to serve a page which describes the error, and what the user can and/or should do about it. We provide a 404 error page that says, "The page you requested is missing or has been removed from our Web site. This error page then provide uses our standard navigation links to help the user find what they were looking for, if the user has not selected anything after 30 seconds we automatically redirect them to the home page via a meta refresh command.
It is more than possible that the search engines may look at your redirected page and consider that it is a duplicate of the home page. Whether this affects your search engine rankings or positions is a question that only the search engines can really answer, there is evidence though that too many pages being redirected to the home page could trigger some sort of penalty.