[英]Apache 2.4 require password on subdomain not seems to be working
My final foal is to as password on every sub domain but not www and local. 我的最终目的是在每个子域(而不是www和本地)上作为密码。
I followed the https://httpd.apache.org/docs/trunk/howto/auth.html guide.
我遵循了https://httpd.apache.org/docs/trunk/howto/auth.html指南。 "Visitors coming from that address will not be able to see the content covered by this directive. If, instead, you have a machine name, rather than an IP address, you can use that."
“来自该地址的访问者将无法看到该指令涵盖的内容。相反,如果您拥有计算机名而不是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>
Still it does not work by not asking password on dev.domain.ee 通过在dev.domain.ee上不询问密码仍然无法正常工作
I found a solution for my own problem. 我为自己的问题找到了解决方案。
<RequireAny>
Require host www.domain.ee
Require local
Require valid-user
</RequireAny>
That telles to require valid user for all other cases except localhost and www.domain.ee 这告诉在除localhost和www.domain.ee之外的所有其他情况下要求有效用户
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.