views:

343

answers:

2

hi friends

404 error page's 200OK header error

what is this?

Server Response: http://www.blabla.com/err404.html HTTP Status Code: HTTP/1.1 200 OK

and it should give 404, my client says..

i researched so much by google, but could not understand the issue.. What should I do to fix this?

appreciate helps!!!

+2  A: 

You will get status 200 if the error page was the actual request (i.e. the error page is requested directly by browser address bar, a bookmark, a redirect in PHP, etc). You will get status 404 if the error page was returned by the webserver itself when there's actually means of invalid request, or when it is dynamically included by PHP along with header("HTTP/1.1 404 Not Found");. In Apache HTTP server the locations for custom error pages are configureable somewhere in httpd.conf.

BalusC
thanks for detailed info. what is so bad about this? it is redirecting to 404 anyway.. i dont get the point.
artmania
You should not redirect. It will result in a 200. I think your major problem is that you don't understand how HTTP works.
BalusC
+4  A: 

I guess that you use ErrorDocument with an absolute URL like:

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

In that case the server responds with a 302 redirect with http://example.com/err404.html as the location. If that URL is then requested, your server is sending the 200 status code as you experienced.

Try just an absolute URL path instead:

ErrorDocument 404 /err404.html
Gumbo
yes, good guess you have :) i had http://www.blabla.com/err404.html url. i just edited as you said, how can i control if it is fine now? where can i see this 200OK error msg? in firebug? or anything else? thanks
artmania
+1 for the guess. @artmania: just request an non-existing URL and check response headers.
BalusC
@artmania: If your website is online, you could use http://web-sniffer.net
Gumbo
I believe artmania is asking *how* to "check response headers". The answer: yes, Firebug can do that, specifically in the Net view, as seen in this screenshot: http://geekswithblogs.net/images/geekswithblogs_net/renso/Firebug/FirebugNetworkAllSample(1).png
Michael Borgwardt
i tried an absolute url path, and tested with web-sniffer.net. it still looks 200 OK ,here is screenshot http://files.droplr.com/files/15306373/9PYdc.View%20HTTP%20Request%20and%20Response%20Header.jpg :(
artmania
@artmania: And what resource did you request? An existing or a non-existing?
Gumbo