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?
Asked
Active
Viewed 205 times
2 Answers
10
Error pages should always be served with the correct status codes.

fields
- 690
- 1
- 10
- 21
-
Thank you -- any chance you have references? – Aaron Gibralter Jun 02 '11 at 01: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 02 '11 at 02: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 02 '11 at 03:36
-
Note that this can't be done effectively on IIS 7.5: http://stackoverflow.com/questions/4968018/coldfusion-error-and-iis7-5-error-pages/6618714#6618714 – Jordan Reiter Jul 08 '11 at 00:47
2
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.

ceejayoz
- 32,910
- 7
- 82
- 106
-
Ahh yeah, I realized that after I posted. I guess Google doesn't have a file called 404.html... lol. – Aaron Gibralter Jun 02 '11 at 03:41