Results 1 to 2 of 2

Thread: Disabling Friendly HTTP Error Messages

  1. #1
    Join Date
    Feb 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Disabling Friendly HTTP Error Messages

    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

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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:
    Code:
    <?php for ($i = 0; $i < 512; ++$i) print ' '; ?>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •