我的httpd.conf是..
<VirtualHost *:80> ServerName example.com DocumentRoot /path/to/dir/ ErrorDocument 403 /my403.html ErrorDocument 404 /my404.html ErrorDocument 500 /my500.html <Directory "/path/to/dir/ "> AllowOverride None Options -Indexes Order deny,allow Deny from all <FilesMatch "\.(JPG|jpg|jpeg|gif|png|css)$"> allow from all </FilesMatch> </Directory> </VirtualHost>
在层次结构的深层页面(/ path / to / dir /)被显示的默认页面什么是错的
访问日志是
客户端被服务器configuration拒绝:/path/to/dir/my403.html
您在允许的文件列表中没有html文件,因此它们在默认情况下被拒绝。 这包括你的自定义错误页面,所以那些也不显示!
我将为您的错误页面创build一个单独的子目录,并且特别允许从该子目录提供html页面。