【发布时间】:2019-07-07 01:49:45
【问题描述】:
我在 .htpasswd 中有用户,在 .htaccess 中有允许的 IP 我想允许用户/密码(对于不在 .htaccss 中的 IP)或 IP 访问(没有身份验证)。
我用这些行编辑了 httpd 中的 dir 部分 但它不要求对允许的 IP 和不在文件中的 IP 要求用户/密码进行身份验证。
<Directory xxx>
AllowOverride All
Options Indexes FollowSymLinks
AuthName "Authentication required!"
AuthType Basic
AuthUserFile <my path>/.htpasswd
<RequireAny>
Require ip 127.0.0.1
Require valid-user
</RequireAny>
</Directory>
【问题讨论】:
标签: apache .htaccess httpd.conf .htpasswd