2014-02-10 40 views
0

我試圖阻止.htaccess中的一個IP,我可以這樣做,但我無法獲得默認的403錯誤以重定向到我的自定義403頁面。
任何人都知道如何做到這一點?Go Daddy 403頁面

ErrorDocument 403 /403/403.html 
+0

是您的403頁的文件夾中叫403? –

+0

是的。並且該文件被稱爲403.html – Peter

回答

0

我想通了

ErrorDocument 403 /error/403.html 

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

當您阻止.htaccess文件中的IP時,您可能會拒絕對文件的訪問。

403目錄內創建另一個.htaccess文件,並在該目錄中允許所有人訪問。然後任何人都應該能夠看到自定義403.html頁面被阻止時。

看看這是否會幫助你解決問題。

更新:

下面是一個例子。

將錯誤文檔行放入 .htaccess文件中。

ErrorDocument 403 /403/403.html 

然後在403目錄內的.htaccess文件只添加這一點。

Order allow,deny 
Allow from all 
+0

它沒有工作繼承人我的代碼:'ErrorDocument 403/403.html order允許,拒絕 允許所有' – Peter

+0

看到我的更新爲例。 –

+0

這個工作,我測試了它。 –