Log in

View Full Version : Disabling Friendly HTTP Error Messages



ryersondg
02-23-2008, 04:43 AM
After battling for several hours to figure out why my custom php error pages were not working on my localhost, I realized that there was nothing at all wrong with the directives in my httpd.conf file or my .htaccess files. Rather, the only thing that was keeping my error pages from showing up was the, "show friendly http error messages" option that was seleceted by default in my installation of IE7.

So, my question is: do I have any control over whether or not a client sees my custom error messages or not? I came across one webpage that claimed that if the server's error message was large enough (512 bytes), that IE would display the custom error message in favor of its own "friendly" message.

Not such a difficult task (to exceed this size limit), but I'm curious if there is a way to gain more control over what is actually displayed by other means.

Also, I'm curious if similar options exist (and are therefore a concern) in other browsers: firefox, opera, etc. Considering the fact that these "friendly" pages don't add much value to the unfortunate experience of clicking on a broken link, I'm surprised I have to deal with this at all.

Thanks in advance for your comments

Twey
02-23-2008, 05:12 AM
IE will display your error page if it's greater than 512 bytes, otherwise one of its own messages (unless it's been explicitly forbidden from doing so). No other browsers that I'm aware of exhibit this behaviour, and will always show your error page if one exists.

It's pretty common to see:
<?php for ($i = 0; $i < 512; ++$i) print ' '; ?>