【发布时间】:2017-04-20 21:55:46
【问题描述】:
我想用密码保护整个 /var/www/html/* 区域,但排除一个文件。 我试过这个代码:
<Files *.*>
AuthType Basic
AuthName "Service-Login"
AuthUserFile /path/tomypasswdfile/...
Require valid-user
</Files>
<Files /index.alternetive.php>
#Order allow,deny
Require all granted
#Allow from All
#Allow from env=allow
#Satisfy any
</Files>
登录功能正常,但适用于所有文件,包括“index.alternative.php”-File。
我的 apache2 在 Ubuntu-Xenial 上运行。
非常感谢
【问题讨论】:
标签: apache .htaccess apache2 password-protection