你好~这是我在stackoverflow上的第一篇文章
我们试图在我们的 htaccess 文件中满足以下条件:
如果你不在某个IP地址范围(111.222.xxx.xxx)且http主机是test.com,那么带用户到test.com/goodbye:
RewriteCond %{REMOTE_ADDR} !^111\.222
RewriteCond %{HTTP_HOST} ^test\.com$
RewriteRule ^.*$ http://test.com/goodbye [R=301,L]
如果您在某个 IP 地址范围内(111.222.xxx.xxx)并且 https 主机是 test.com 则将用户带到 test.com/hello:
RewriteCond %{REMOTE_ADDR} ^111\.222
RewriteCond %{HTTP_HOST} ^test\.com$
RewriteRule ^.*$ http://test.com/hello [R=301,L]
无论我使用哪个 IP,我都会被带到 /hello。我假设第一个条件以某种方式失败?