gpt4 book ai didi

apache - 从 htpasswd 中排除文件夹

转载 作者:行者123 更新时间:2023-12-03 23:23:30 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com