Your 404 Error Page Returns a Status of 200 in the Header

Google webmaster tools says: “We’ve detected that your 404 (file not found) error page returns a status of 200 (Success) in the header.“.

Status codes:

  • 200 – The request was fulfilled.
  • 404 – The server has not found anything matching the URI given.

Why is this a problem? Well for a normal user with a browser this has no effect what so ever, but from a search engines perspective if you return status 200 instead of 404 you are basically saying: “yes, this page exists and you can index it” while in fact it does not exist and it should not be indexed.

How to fix this in asp.net:

You can use:

<% Response.Status = "404 Not Found" %>

or from code behind:

protected void Page_Load(object sender, EventArgs e)
{
 Response.Status = "404 Not Found";
}

Leave a Reply

Your email address will not be published. Required fields are marked *