2016-12-03 90 views
1

我的目标是类似于这里提出这样的问题:覆盖的.htaccess filesmatch密码保护

How to remove .htaccess password protection from a subdirectory

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

然而,即使我创建了.htaccess文件中说subdirectiory具有以下内容:

Require all granted 

我在更高的目录仍要求进行身份验证从.htaccess文件:

DirectoryIndex index.html 

<FilesMatch "index.html"> 
AuthUserFile /etc/users 
AuthName "Protected" 
AuthGroupFile /dev/null 
AuthType Basic 
Require valid-user 
</FilesMatch> 

如何覆盖子目录中的这个FilesMatch块,以便不需要登录?在我的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正确设置。我究竟做错了什么?

回答

1

在您的subdirectory/.htaccess有这两条线,防止AUTH:

Satisfy Any 
Allow from all