I noticed that, say, goolge's 404 page returns a 404 status (http://www.google.com/404.html) while github's returns 200 (https://github.com/404.html). Should error pages (even 503s, etc.) always be served with the correct status codes? Or should front end servers intercept them and display 200ed error pages?


Error pages should always be served with the correct status codes.

  • Thank you -- any chance you have references? – Aaron Gibralter Jun 2 '11 at 1:32
  • 3
    @Aaron - besides common sense? I don't know why on earth github would return a 200 OK on a 404 page... – Mark Henderson Jun 2 '11 at 2:05
  • @Mark Henderson Access any other invalid URL on GitHub and it'll return a 404. 404.html is a real HTML page that's presumably included when a 404 is encountered. – ceejayoz Jun 2 '11 at 3:36
  • Note that this can't be done effectively on IIS 7.5: stackoverflow.com/questions/4968018/… – Jordan Reiter Jul 8 '11 at 0:47

GitHub's 404.html page is returning 200 because you're directly accessing their 404 template.

https://github.com/lollerskates returns a 404 status code, as it should be.

  • Ahh yeah, I realized that after I posted. I guess Google doesn't have a file called 404.html... lol. – Aaron Gibralter Jun 2 '11 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.