Htaccess and custom error docs


#1

Hey there, I have a site where I’m using custom error pages using the following code in my htaccess file in the web root:

Options -indexes ErrorDocument 404 /oops/404.php ErrorDocument 500 /oops/500.php ErrorDocument 401 /oops/401.php ErrorDocument 403 /oops/403.phpbad url:
http://disk919.com/buttcrack/

Actually, I have this on 3 sites, 1 works, the other 2 do not. one site has a slight variation (essentially same tho):

Options -indexes ErrorDocument 400 /error.php?code=400 ErrorDocument 401 /error.php?code=401 ErrorDocument 403 /error.php?code=403 ErrorDocument 404 /error.php?code=404 ErrorDocument 500 /error.php?code=500 ErrorDocument 501 /error.php?code=501 ErrorDocument 502 /error.php?code=502 ErrorDocument 503 /error.php?code=503 bad url:
http://andredion.com/buttcrack/

I have a site that’s using the EXACT same .htaccess file as the first example and it’s working fine. I even checked permissions on the directories and files involved and made them match the one that is working (shouldn’t matter tho right?).

To top things off, the friend at anredion.com mailed support and got the following response:

[quote]
Looks like its working just fine for me… I dont see our default error
docs when i try to access pages that do not exist… i just see

Error 403: Forbidden [/quote]
should be getting a 404 error there from the description. Why would support be able to see custom error pages, although the wrong one, when noone else in Canad or the US can?

Little confused here =)

[color=#0000CC]jason[/color]


#2

well, I’ve tried it now in opera and netscape and I’m getting the proper error pages on both domains! WooHoo!

I’m still uttery confused however as in IE6 I’ve been able to see the custom pages fine on the one site, but not the other 2.

Off to check caching and Internet Options in IE…

[color=#0000CC]jason[/color]


#3

Make sure you have “show friendly error pages” (or something like that) UNchecked.


#4

well, replying to my own post seconds later…

I cleared my cahce / history / cookies to no avail, but…

IE / Tools / Internet Options / Advanced Tab
Uncheck show friendly HTTP error messages

I had no idea this would override custom error pages. In fact, still a bit of a mystery cuz I was seeing custom pages on some sites and not others.

[color=#0000CC]jason[/color]


#5

snuck one in on me there man =)

[color=#0000CC]jason[/color]


#6

If I remember correctly, at one point, the IE “friendly” error pages were supposed to be generated only if the browser rec’d the appropriate HTTP message (403, 404, etc.) and if the length of the content sent by the response was less than a certain size (512 bytes, I think?).

OK, after a little Googling, I found the following article in the MS Knowledge Base: http://support.microsoft.com/default.aspx?scid=kb;EN-US;218155 – My above assertion is basically confirmed, that in a nutshell, for Win-IE5+, there are Registry entries specifying thresholds for the content length of error messages, and if the rec’d error page is less than the threshold, then IE will display it’s “friendly” error message.


#7

fantastic, this was really bugging me and I was prepared to do some serious research, thanks for beating me to it! =)

[color=#0000CC]jason[/color]