Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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
Apache 重写子目录中的.htaccess filesmatch密码保护_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 重写子目录中的.htaccess filesmatch密码保护

Apache 重写子目录中的.htaccess filesmatch密码保护,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我的目标与这里提出的问题类似: .htaccess文件保护子目录中的所有index.html文件。我想从这个规则中排除一个特定的子目录 但是,尽管我在上述子目录中创建了.htaccess文件,其中包含以下内容: Require all granted 我仍然需要从较高目录下的.htaccess文件进行身份验证: DirectoryIndex index.html <FilesMatch "index.html"> AuthUserFile /etc/users AuthName

我的目标与这里提出的问题类似:

.htaccess
文件保护子目录中的所有
index.html
文件。我想从这个规则中排除一个特定的子目录

但是,尽管我在上述子目录中创建了
.htaccess
文件,其中包含以下内容:

Require all granted
我仍然需要从较高目录下的
.htaccess
文件进行身份验证:

DirectoryIndex index.html

<FilesMatch "index.html">
AuthUserFile /etc/users
AuthName "Protected"
AuthGroupFile /dev/null
AuthType Basic
Require valid-user
</FilesMatch> 
DirectoryIndex.html
AuthUserFile/etc/users
AuthName“受保护”
AuthGroupFile/dev/null
AuthType Basic
需要有效用户
如何在子目录中重写此FileMatch块,以便不请求登录?在我的apache配置文件中:

<Directory />
        Options FollowSymLinks
        AllowOverride All
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride All
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

选项如下符号链接
允许超越所有
要求全部拒绝
允许超越所有
要求所有授权
选项索引跟随符号链接
允许超越所有
要求所有授权

我确实正确设置了
AllowOverride
。我做错了什么?

在您的
子目录中/.htaccess
有以下两行代码来防止身份验证:

Satisfy Any
Allow from all