我想知道如何configurationApache 2为403(禁止)和404(页面未find)响应指定相同的错误文档。 我假设有一个指令添加到httpd.conf,但不知道它是什么。
我所看到的大部分教程都基于.htaccess文件,但是我想在全局设置这个指令。
添加一个块,如:
ErrorDocument 403 /40x.html ErrorDocument 404 /40x.html
进入服务器或虚拟主机configuration。
这里是文档的相关部分:
http://httpd.apache.org/docs/2.2/mod/core.html#errordocument
您可以使用ErrorDocument指令在httpd.conf中全局设置它
ErrorDocument 404 /error.html ErrorDocument 403 /error.html