apache - 从 htpasswd 中排除文件夹

标签 apache .htaccess .htpasswd

我需要使用用户名/密码对网站进行密码保护,但需要保持“/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/

相关文章:

apache - JMeter - jorphan 代表什么

python - 无法使用 apache mod WSGI 在 ubuntu 上部署 Django

regex - 如何使用 mod_rewrite 将文件夹中的所有文件重定向到除少数文件之外的另一个目录?

.htaccess - Codeigniter 4 多站点

wordpress - 使用 .htaccess 从一个域重定向到另一个域

.htaccess 与 protected 目录 (.htpasswd) 冲突

php - 使用htaccess根据域名进行限制

Apache 为新文件获取 403

php - 以编程方式构建 htpasswd

apache - 当 URL 包含百分号 % 符号时如何停止错误 400? ( Apache )