我需要使用用户名/密码对网站进行密码保护,但需要保持“/assets”文件夹可访问,因为图像/css 等文件被嵌入到其他网站上。
我有这个保护:
Order Allow,Deny
AuthType Basic
AuthName "Password"
AuthUserFile /var/www/.htpasswd
Require valid-user
Satisfy Any
如何指定保护/assets 文件夹中的所有内容?
最佳答案
你会在 .htaccess
中使用assets/
中的文件目录:
Satisfy Any
Order Allow,Deny
Allow from all
请参阅此处的示例:http://httpd.apache.org/docs/2.2/mod/core.html#require
关于apache - 从 htpasswd 中排除文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9856951/