Linux ErrorDocument 403不适用于子目录
我在共享主机上有这样的结构:Linux ErrorDocument 403不适用于子目录,linux,apache,.htaccess,http-status-code-403,Linux,Apache,.htaccess,Http Status Code 403,我在共享主机上有这样的结构: ~/above_public_html/public_html/directory_i_want_forbidden 我有一个~/over\u public\u html/.htaccess,包含以下内容: ErrorDocument 403 /403.html ErrorDocument 404 /404.html 当我导航到一个不存在的文件或文件夹时,我会弹出404.html,没有问题 当我导航到存在但具有chmod 700权限(包括目录\u我想要\u禁止)
~/above_public_html/public_html/directory_i_want_forbidden
我有一个~/over\u public\u html/.htaccess
,包含以下内容:
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
当我导航到一个不存在的文件或文件夹时,我会弹出404.html,没有问题
当我导航到存在但具有chmod 700
权限(包括目录\u我想要\u禁止
)的子文件夹或文件时,我得到:
要使
错误文档403/403.html
正常工作,我需要做什么?上游的.htaccess或httpd.conf出现问题。我无法控制它,因为我是共享主机。此后,我启动了自己的Amazon EC2服务器实例,一切正常。由于出现错误,似乎也禁止访问403.html
。检查该文件的chmod设置。它是否会在~/upper\u public\u html/public\u html/directory\u i\u want\u probled
目录中查找403.html?否。我将.htaccess文件修改为errordocument403http://www.mysite.com/403.html
但仍然得到相同的错误!发生什么事了?是的。。没有使用代码标记,因此它切断了http://
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