Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 从htpasswd中排除文件夹_Apache_.htaccess_.htpasswd - Fatal编程技术网

Apache 从htpasswd中排除文件夹

Apache 从htpasswd中排除文件夹,apache,.htaccess,.htpasswd,Apache,.htaccess,.htpasswd,我需要使用用户名/密码对网站进行密码保护,但需要保持“/assets”文件夹的可访问性,因为其他网站上嵌入了图像/css等文件 我有这样的保护: Order Allow,Deny AuthType Basic AuthName "Password" AuthUserFile /var/www/.htpasswd Require valid-user Satisfy Any 如何指定保护/assets文件夹中的所有内容?您将在assets/目录中的.htaccess文件中使用: Satisfy

我需要使用用户名/密码对网站进行密码保护,但需要保持“/assets”文件夹的可访问性,因为其他网站上嵌入了图像/css等文件

我有这样的保护:

Order Allow,Deny
AuthType Basic
AuthName "Password"
AuthUserFile /var/www/.htpasswd
Require valid-user
Satisfy Any

如何指定保护/assets文件夹中的所有内容?

您将在
assets/
目录中的
.htaccess
文件中使用:

Satisfy Any
Order Allow,Deny
Allow from all

请参见此处的示例:

Ah我陷入了单一的.htaccess思维模式。这很有效。非常感谢。