为什么此重定向代码失败并显示"webpage has a redirect loop"
浏览器错误消息。?
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^(24\.57|25\.0) [OR]
RewriteCond %{REMOTE_ADDR} ^(49\.(4|51|52|64|112|120|128|140|152|208|210|220|232|239)|54\.222) [OR]
RewriteCond %{REMOTE_ADDR} ^(91\.234|134\.196|159\.226|161\.207|162\.105|166\.111|167\.139) [OR]
RewriteCond %{REMOTE_ADDR} ^(168\.160|192\.(124|188)|193\.0)
RewriteRule ^(.*)$ http://www.website.com/folder/redirect.html [L,NC,R]
目的是通配ip范围并将这些范围重定向到
http://www.website.com/folder/redirect.html
答案 0 :(得分:0)
尝试此规则:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^(24\.57|25\.0) [OR]
RewriteCond %{REMOTE_ADDR} ^(49\.(4|51|52|64|112|120|128|140|152|208|210|220|232|239)|54\.222) [OR]
RewriteCond %{REMOTE_ADDR} ^(91\.234|134\.196|159\.226|161\.207|162\.105|166\.111|167\.139) [OR]
RewriteCond %{REMOTE_ADDR} ^(168\.160|192\.(124|188)|193\.0)
RewriteRule !^folder/redirect\.html http://www.website.com/folder/redirect.html [L,NC,R]