This is my code: why doe开发者_运维知识库s this end in a infinite loop? (the idea was to forward all IP's except 1).
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !=91.198.106.118
RewriteCond %{REQUEST_URI} !^/page\.html$
RewriteRule ^(.*)$ http://domain.nl/i/page.html [R=307,L]
I think you should remove ^
from request_uri
Assuming this is the same domain, you're redirecting everything to /i/page.html
except /page.html
. Strip out /i/page.html
instead.
Put this code in your .htaccess:
Options -MultiViews +FollowSymLinks
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !=91.198.106.118
RewriteRule ^(?!i/page\.html).*$ http://domain.nl/i/page.html [R=307,L,NC]
精彩评论