我已使用以下规则排除了200.200.0.17从http重定向到https的情况,但其请求(从200.200.0.17)仍在重定向到https。任何帮助将不胜感激。
<VirtualHost _default_:80>
# If mod_rewrite is present, it takes precedence over mod_alias
# and it is necessary to rewrite the request to https.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^200.200.0.17
RewriteRule (.*) https://%{HTTP_HOST}$1
</IfModule>
# Otherwise use mod_alias to redirect.
Redirect / https://%{HTTP_HOST}/
</VirtualHost>
在执行第一个规则之后,还将执行第二个规则。为防止这种情况发生,请使用该last
标志。更改代码中的行:
RewriteRule (.*) https://%{HTTP_HOST}$1 [L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句