Forum Moderators: phranque

Message Too Old, No Replies

Soft 404

         

nioub

6:21 pm on Nov 9, 2007 (gmt 0)

10+ Year Member



We're using a custom 404 error page in our .htaccess file to redirect users if they visit a dead page.

The problem is that Google's Webmaster Tools verification says we're using a "soft 404" and that the header response is a "200" instead of a "404".

Example:
ErrorDocument 404 http://www.example.com/
or
ErrorDocument 404 /404.html

We're using industry standards for the 404 error directive in the .htaccess file, so what are we doing wrong and where do we need to look for a solution?

How do we get the header response to show a 404 error code instead of the 200 it presently is?

Thanks in advance!

nioub

jdMorgan

9:29 pm on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First step, fix your ErrorDocument directives:

This is incorrect, and will produce a 302-Found response, as documented [httpd.apache.org] by Apache:


ErrorDocument 404 http://www.example.com/404.html

The correct format is the second one you show:

ErrorDocument 404 /404.html

Next, download and install the "Live HTTP Headers" add-on in your Firefox or Mozilla-based browser. This will allow you to watch requests to and responses from your server in virtual real-time. Follow the browser request, any intervening redirects, and the final response code to see if there is really a problem.

If you provide user-agent-based content, you may also want to install the user-agent switcher add-on, so you can make requests with your browser sending a valid Googlebot user-agent string.

Jim

[edited by: jdMorgan at 9:29 pm (utc) on Nov. 9, 2007]