2013-03-01 98 views
0

我有這樣的結構的共享主機:的ErrorDocument 403不工作的子目錄

~/above_public_html/public_html/directory_i_want_forbidden 

我有以下內容的~/above_public_html/.htaccess

ErrorDocument 403 /403.html 
ErrorDocument 404 /404.html 

當我導航到一個文件或文件夾這不存在,我得到了404.html彈出,沒有問題。

當我瀏覽到存在但是chmod 700權限(包括directory_i_want_forbidden)的子文件夾或文件,我得到:

Forbidden 

You don't have permission to access /directory_i_want_forbidden on this server. 

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. 

Apache Server at www.mydomain.com Port 80 

我需要什麼,以便正確地使ErrorDocument 403 /403.html工作要做?

+0

由於錯誤似乎訪問'403.html'也被禁止。檢查該文件的chmod設置。 – 2013-03-01 04:42:35

+0

它會在'〜/ above_public_html/public_html/directory_i_want_forbidden'目錄中查找403.html嗎? – 2013-03-01 04:56:54

+0

沒有。我將.htaccess文件修改爲「ErrorDocument 403 http:// www.mysite.com/403.html」,但仍然出現相同的錯誤!到底是怎麼回事? – 2013-03-01 05:11:31

回答

0

某些東西與上游的.htaccess或httpd.conf相矛盾。自從我共享主機後,我無法控制它。自那以後,我開始了自己的Amazon EC2服務器實例,並且所有事情都按照它應該的方式工作。