2016-12-03 91 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