.htaccess error pages

Hi, I’ve got a .htaccess file, which displays the error pages on my server. The pages for errors like error 404 and 403 work, they occur when I type a non-existing URL or something. But my error500 page does not work. I made an error in my .php file, but when I open this file using Internet Explorer, the standard page pops up and not my home-made error500 page. Why doesn’t it show my error500 page and does it show the other error pages? Is it because apache at least tries to execute the page, instead of just telling me it doesn’t exist, or do I have to change more settings? I hope somebody recognices the problem, I couldn’t find it on the internet anywhere :stuck_out_tongue:

Thanks! Superdude

Might be of help… or not.
But you may want to use lynx and run

lynx -head -dump "http://www.yoursite.com/yourPageWhichShouldGiveBackA505Error.php"

To confirm it’s actually throwing a 500
or use

header('HTTP/1.1 500 Internal Server Error');

at the very start of your test page and/or in your exception handler if you want this to happen.
(if you use it in an exception handler you’ll have to to clear any output thus far created as headers have to be at the very start of the output.)

Hi, thanks for the reply. Lynx confirms that my sabotaged page gives an error500, but I still don’t see my custom error page. I tried setting all the AllowOverride thingy’s to All but still it won’t show the page, just the standard error page. When I run lynx I get the following message: HTTP/1.0 500 Internal Server Error. When I type the url of any other page I says: HTTP/1.1 200 OK. Has it got something to do with the 1.1/1.0? I hope you can help,

greetsz, Superdude

Mmmh just tested it on my own server with the same result.
404 Works, 500 doesn’t.

Can’t figure out why though… at least it’s reproducible.

Haha, thanks for checking anyway. I’ll continue my search and let you know if I find anything. If anybody else knows how to solve the problem, feel free to post the answer here :slight_smile:


Please post the .htaccess file here and have a look at your server error and access logs if there is something in there what may help.



put this line in your .htaccess file.

ErrorDocument 500 /error-docs/500.shtml

and put the 500.shtml file in that directory.

Hi,'I’m sorry for the late reply, I was on a holiday ;). I have the following lines in my .htaccess file:

ErrorDocument 403 /errors/error403.php
ErrorDocument 404 /errors/error404.php
ErrorDocument 500 /errors/error500.php

If I access my document via http://myserveradress/errors/error500.php everything works fine and I get the page I designed. I’m using macromedia dreamweaver 8.0 to edit my files, does that do anything with server-errors? As said before if I access http://myserveradress/thispagedoesnotexist.php my error404.php page does work. Hope you can help,

greetsz, Superdude