I'm not sure whether this is a mistake in the Apache documents or a bug in the code, but according the Apache HTTPD document here: http://httpd.apache.org/docs-2.0/mod/core.html#errordocument The context for ErrorDocument is listed as "server config, virtual host, directory, .htaccess" I have a directory container setup like this: <Directory /> ErrorDocument 403 /globalerrors/403.php ErrorDocument 404 /globalerrors/404.php ErrorDocument 500 /globalerrors/500.php Options [masked from this post for security] IndexOptions [masked from this post for security] AllowOverride [masked from this post for security] </Directory> The 403 and 404 error documents work as expected, but when I try to trigger the 500 error document, Apache instead displays the normal Apache stock 500 error document. After consulting on this with some folks in the apache IRC channel, I discovered that moving the ErrorDocument 500 directive outside of the root directory container and into the main config, the custom 500 error starts to work. So I figure that this is either a mistake in the documentation or a bug in Apache httpd.
(In reply to comment #0) > I'm not sure whether this is a mistake in the Apache documents or a bug in the > code, but according the Apache HTTPD document here: > > http://httpd.apache.org/docs-2.0/mod/core.html#errordocument > > The context for ErrorDocument is listed as "server config, virtual host, > directory, .htaccess" > > I have a directory container setup like this: > > <Directory /> > ErrorDocument 403 /globalerrors/403.php > ErrorDocument 404 /globalerrors/404.php > ErrorDocument 500 /globalerrors/500.php > Options [masked from this post for security] > IndexOptions [masked from this post for security] > AllowOverride [masked from this post for security] > </Directory> > > The 403 and 404 error documents work as expected, but when I try to trigger the > 500 error document, Apache instead displays the normal Apache stock 500 error > document. After consulting on this with some folks in the apache IRC channel, > I discovered that moving the ErrorDocument 500 directive outside of the root > directory container and into the main config, the custom 500 error starts to > work. So I figure that this is either a mistake in the documentation or a bug > in Apache httpd. I had exactly this problem with an ErrorDocument for error 414. Custom error document would not work in .htaccess or directory container. (Custom 404 error documents with exactly the same details would work.) Only solution found to work was to put entry in main confiuguration as for original error 500 report. running Server Version: Apache/2.0.52 (Fedora) Server Built: Nov 11 2004 10:31:42
Some errors are generated before the <Directory block or .htaccess files are read. Those errors will not be affected by these settings. I think this is really a documentation bug.
ErrorDocument docs now mention that certain errors can't be overridden in certain circumstances. Not many details, but I think its good enough.