去爸爸403页面

时间:2014-02-10 16:36:37

标签: .htaccess redirect ip http-status-code-403

我试图阻止.htaccess中的ip,我可以这样做但我无法获得默认的403错误来重定向到我的自定义403页面。
谁知道怎么做?

ErrorDocument 403 /403/403.html

3 个答案:

答案 0 :(得分:1)

当您阻止.htaccess文件中的IP时,您可能会拒绝访问该文件。

.htaccess目录中创建另一个403文件,.htaccess允许所有人访问。然后,任何人都应该能够在被阻止时看到自定义的403.html页面。

看看这是否有助于解决您的问题。

<强>更新

这是一个例子。

将错误文档行放在 root .htaccess文件中。

ErrorDocument 403 /403/403.html

然后在403目录中的.htaccess文件中只添加此内容。

Order allow,deny
Allow from all

答案 1 :(得分:0)

答案 2 :(得分:0)

我想出来了

ErrorDocument 403 /error/403.html

order allow,deny 
deny from xxx.xxx.xxx.xx
allow from all