Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Are the files in that directory readable by the webserver user? What does the apache error_log say? –  theotherreceive Jul 15 '09 at 23:42
    
Visiting /errors/default.html directly works or throws the same error? –  Jorge Bernal Jul 30 '09 at 15:50
    
Works. Notably, the docs specify that ErrorDocuments are handled "relative to the DocumentRoot". –  Charles Duffy Jan 18 '11 at 7:09

1 Answer 1

I use the following configuration:

Alias /error/ /var/www/err/
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html

Just add a "/" to your alias and you should be fine...

share|improve this answer
    
Hum - tried that, and it still doesn't work. Does there have to be a directory section applied to the alias directory? –  Pete Jun 17 '09 at 17:26
    
yes, do you got mod_alias loaded? –  rkthkr Jun 17 '09 at 17:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.