.htaccess IP 地址白名单不起作用,仍然收到 403 forbidden

.htaccess IP address whitelist not working, still receive 403 forbidden

公司客户端有 IP 地址 xxx.xxx.xxx.xxx/32

我已将以下内容添加到 /wp-admin/.htaccess

order deny,allow
allow from xxx.xxx.xxx.xxx/32
deny from all

但是,当公司网络上的员工访问 www.example.com/wp-admin 时,他们会收到 403 forbidden 错误。

如果他们访问 www.whatismyip.com,他们会被告知他们的 IP 地址与上述相同。

感谢帮助。

编辑:

www.example.com/.htaccess 还包含以下内容:

<Files wp-login.php>
order deny,allow
allow from xxx.xxx.xxx.xxx/32
deny from all
</Files>

应该按顺序进行,因为 'deny from all' 是您示例中的最后一条规则。试试这个:

Order Deny,Allow
Deny from all
Allow from 111.111.111.111