htaccess - 如何排除限制区域的一个文件夹

htaccess - How to exclude one folder of the restricted area

我的 .htaccess 看起来像这样:

AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /var/www/.htpasswd 
AuthGroupFile /dev/null 
require valid-user

现在我想把文件夹"test"排除在禁区之外,我试着加上这个:

<Directory /var/www/test/*/>
  Allow from all 
  Satisfy any
</Directory>

但是我收到了 500 内部服务器错误。我能做什么?

<Directory> 实际上在 .htaccess 中是不允许的。

您可以通过使用以下 1 行创建 /test/.htaccess 来解决它:

Satisfy any