【发布时间】:2016-10-13 15:36:58
【问题描述】:
我的最终目标是作为每个子域的密码,但不是 www 和本地。
我遵循https://httpd.apache.org/docs/trunk/howto/auth.html 指南。 “来自该地址的访问者将无法看到该指令涵盖的内容。如果您有机器名称而不是 IP 地址,则可以使用它。”
AuthType Basic
AuthName "Password Required"
<If "req('Host') == 'dev.domain.ee'">
AuthUserFile /path/dev/.htpasswd
</If>
<If "req('Host') == 'test.domain.ee'">
AuthUserFile /path/test/.htpasswd
</If>
<If "req('Host') == 'prelive.domain.ee'">
AuthUserFile /path/prelive/.htpasswd
</If>
<RequireAll>
Require all granted
Require not host dev.domain.ee test.domain.ee prelive.domain.ee
</RequireAll>
在 dev.domain.ee 上不询问密码仍然无法正常工作
【问题讨论】: