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