Forum Moderators: phranque

Message Too Old, No Replies

Server Is Not Returning 404

Why Server Is Not Returning 404

         

abhishekmishra

4:48 am on Jun 14, 2012 (gmt 0)



Hi,
I created custom 404 web pages in a website but whenever i'm checking this thing my server is not returning 404 status...
can anyone tell me what's reason behind it?

phranque

5:21 am on Jun 14, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what are you requesting?
what response are you getting?

what does your ErrorDocument directive look like?

abhishekmishra

5:41 am on Jun 14, 2012 (gmt 0)



every page which does not exist on server should return 404 error code but our server is not returning 404 error page while it is returning 200 code for that request and redirecting to example.com/page_not_found

lucy24

5:49 am on Jun 14, 2012 (gmt 0)

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



Overlapping previous replies

Yes, probably. But you need to give concrete and detailed information.

Are you not getting a 404 error at all-- or are you getting a 404 error but not seeing your custom page?

Does your error document have a standard name (like "missing") that your server looks for? Or are you using an ErrorDocument directive?

There should not be any relationship between having a custom error page and getting an error; the page is just something for the human eyeballs to look at. BUT there's an exception, and it involves a common error. That is, an error in the site, not an error for the visitor.

By "checking this thing" do you mean that you deliberately ask for nonexistent pages, and then check logs or Live Headers? What response do you get instead?

That's only a start. More information. More details. It isn't enough to say "it doesn't work". You know what happens-- or doesn't happen. We don't.

Edit:
Did you get the bit about "a common error"? Crystal ball strongly suggests that's where the explanation lies.

g1smd

6:04 am on Jun 14, 2012 (gmt 0)

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



What does your ErrorDocument directive look like?

The Apache manual warns on how to avoid getting a 302 redirect when there is a missing-page error.