我想将我devise良好的一组http错误文档存储在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
但是,当我这样做时,我所得到的是“所请求的URL / error / default.html导致错误”。
在Apache 2.0中是否可以像这样一起使用mod_alias和ErrorDocument指令?
我使用以下configuration:
Alias /error/ /var/www/err/ ErrorDocument 400 /error/HTTP_BAD_REQUEST.html
只需添加一个“/”到你的别名,你应该没问题…