ErrorDocument 403不适用于子目录

时间:2013-03-01 03:47:54

标签: linux apache .htaccess http-status-code-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正常工作,我需要做些什么?

1 个答案:

答案 0 :(得分:0)

上游的.htaccess或httpd.conf有点麻烦。自从我在共享主机上以来,我无法控制它。我已经创建了自己的Amazon EC2服务器实例,一切正常。

相关问题