Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux ErrorDocument 403不适用于子目录_Linux_Apache_.htaccess_Http Status Code 403 - Fatal编程技术网

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