0
我的最后一个驹是在每个子域名上输入密码,但不是www和local。Apache 2.4在子域名上需要密码,似乎没有工作
我遵循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