Forum Moderators: phranque

Message Too Old, No Replies

Check Server Headers

Why is my 404 page returning a 200?

         

pageoneresults

4:02 pm on Mar 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Server Header Tool

At the top left of this page resides the WebmasterWorld logo. To the right of that is a control panel link, click that. Over on the left, under the calendar, is a section called Plugins. The third link is a Server Headers tool for your use.

Status Codes

There are seven HTTP status codes (200¦301¦302¦304¦307¦404¦410) that we are primarily interested in from an indexing and search engine marketing perspective. It is recommended that you verify your URIs are returning the proper Status-Code in the Server Header.

  1. HTTP Status Code - 200 OK
    The request has succeeded. The information returned with the response is dependent on the method used in the request.

  2. HTTP Status Code - 301 Moved Permanently
    The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs.

  3. HTTP Status Code - 302 Found
    The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests.

  4. HTTP Status Code - 304 Not Modified
    If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.

  5. HTTP Status Code - 307 Temporary Redirect
    The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

  6. HTTP Status Code - 404 Not Found
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

  7. HTTP Status Code - 410 Gone
    The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval.

    If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 Not Found SHOULD be used instead. This response is cacheable unless indicated otherwise.

Complete References

There are many topics that appear at WebmasterWorld that are directly and indirectly related to the headers that your server is returning for a specific URI. For example, topics surrounding Custom 404 Pages. Many are surprised when they come here wondering why their 404 pages are returning a Status Code of 200. This is a major flaw in the script they are using or they've not configured it properly so that it does return a 404.

Another common issue is a URI returning a 302 instead of a 301. There are thousands of topics here surrounding the issues that a 302 may cause if implemented incorrectly (and even correctly).

You're probably wondering about the 304, 307 and 410 Status Codes. While we don't see much discussion on these at WebmasterWorld, they are of value in the overall scheme of things. For example, if a page is permanently removed, never to return again, that page should probably return a 410 Gone as opposed to a 404 Not Found.

Okay, start checking those Server Headers. See any problems?

Note: For those that are new to this, most of your public viewable pages should be returning a 200 OK status.

If you've instructed your host to redirect example.com to www.example.com (root domain to sub-domain), the example.com should be returning a 301 Moved Permanently status while the destination URI should be returning a 200 OK status. If set up properly and your browser is not set up to ignore redirects, when you enter example.com you should be redirected to www.example.com and the address should physically change in your address bar.

We're now open for Q&A!