Tag Archives: Chrome

Suprising things no one bothered to tell me about custom 404 pages

27 Sep

I thought that 404 pages, which indicates that no content was found at the specified address, are about the most trivial aspect of the web, turns out I was wrong. A couple of weeks ago  a client asked me to add a 404 page to his WordPress theme, and since I like to leave as much control as I can at the hands of the site owner (reduces my headaches) I had to figure out how to integrate it into WordPress, and today I read one of the Firefox developers mentioning that he works on how Firefox should handle 404 pages.

I was surprised to learn that internet explorer and chrome will simply ignore your custom 404 page if it is shorter than 512 bytes, assuming that such a small message was automatically generated by the server and do not contain any useful information to the user. Therefor, if your 4040 page is shorter than 512, you should add some HTML comments to it to make it bigger.

Somewhat less surprising, but very interesting, is an article in a list apart which suggests that the 404 page should be dynamic with different pages served in different 404 contexts.

BTW: most WordPress themes serves what should be 404 pages as a 200 (success) pages. My solution fell into this trap too :(