setting the ErrorDocument directive

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

setting the ErrorDocument directive

Post by jasongr »

Hello

I am doing some experiments with the ErrorDocument directive in my httpd.conf file
I tried the following:

Code: Select all

ErrorDocument 404 "No page for me - one year!"
I also tried

Code: Select all

ErrorDocument 404 "/error.html"
I restarted Apache and tested the code locally by going to http://localhost/nonexistingfile.html

I am not getting error.html nor my error message...

I can see the browser's caption: HTTP 404 Not Found
But I keep getting the regular default browser message...

what could I be doing wrong?

thanks in advance
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

Post by jasongr »

Found the problem:
Microsoft Internet Explorer (MSIE) will by default ignore server-generated error messages when they are "too small" and substitute its own "friendly" error messages. The size threshold varies depending on the type of error, but in general, if you make your error document greater than 512 bytes, then MSIE will show the server-generated error rather than masking it
The bastards in Microsoft are playing tricks with me

I also needed to define the URL like so:

Code: Select all

ErrorDocument 404 /error.html
Post Reply