如果有的话,Apache 2.2 将其自定义错误存储在哪里?

如果有的话,Apache 2.2 将其自定义错误存储在哪里?

我正在尝试在 Apache 2.2 设置上设置自定义错误页面(403、404 等)。我知道在 IIS7.5 上,页面存储在

%系统驱动器%\inetpub\custerr\en-US\404.htm

但不确定它们在 Apache 上的位置(或者是否存在)。我需要更改 .config 文件或类似文件吗?

答案1

通常此类信息在您的 中定义.htaccess。例如:

ErrorDocument 500 http://foo.example.com/cgi-bin/tester
ErrorDocument 404 /cgi-bin/bad_urls.pl
ErrorDocument 401 /subscription_info.html
ErrorDocument 403 "Sorry can't allow you access today" 

更多信息:http://httpd.apache.org/docs/2.0/mod/core.html#errordocument

答案2

这通常只是在服务器的默认 DocumenRoot 中。虽然这可能是一个不好的例子,但 cPanel 将其默认 404 存储在 /usr/local/apache/htdocs/ 中

库存配置还将从所有其他不匹配请求的默认文档根目录加载它们。

相关内容