我正在使用 htaccess 技术阻止一些 IP 地址,这适用于我的所有页面,除了显示 Fedora Core 测试页面的站点/文档根目录。
我知道在根目录中找不到文档时会显示测试页面,因此我创建了多个文档并设置了目录索引,其中 index.php 是我的常规文档根文件。
注意我无权访问 /etc/httpd/conf.d/welcome.conf
下面是相关的htaccess代码:
DirectoryIndex index.php index.html 403.php
ErrorDocument 403 /403.php
order allow,deny
deny from 5.39.218
deny from 146.0.74
deny from 5.39.219
deny from 176.102.38
allow from all
<FilesMatch "(403.php|hero.jpg|index.html)$">
order allow,deny
allow from all
</FilesMatch>
有没有办法为网站根目录显示我的自定义 403 页面?
任何建议将不胜感激。