Can I use Apache 2.0 ErrorDocument and Mod Alias to store error pages outside the DocumentRoot?

Posted by Pete on Server Fault See other posts from Server Fault or by Pete
Published on 2009-06-17T15:57:20Z Indexed on 2010/03/24 19:03 UTC
Read the original article Hit count: 398

Filed under:

I'd like to store my nicely designed set of http error documents outside the DocumentRoot.

Alias /errors /data/opt/apache-httpd-2.0.63/htdocs/errorpages/
<Directory  "/data/opt/apache-httpd-2.0.63/htdocs/errorpages/">
    order deny,allow
    allow from all
</Directory> 

ErrorDocument 500 /errors/500.html
ErrorDocument 404 /errors/404.html
ErrorDocument 401 /errors/default.html
ErrorDocument 403 /errors/default.html
ErrorDocument 502 /errors/default.html
ErrorDocument 503 /errors/default.html

However, when I do this, all I get is "The requested URL /errors/default.html resulted in an error."

Is it possible to use mod_alias and the ErrorDocument directive together like this in Apache 2.0?

© Server Fault or respective owner

Related posts about apache2