0

This is my code: why does 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]
Cœur
  • 37,241
  • 25
  • 195
  • 267
VVV
  • 1
  • 1

3 Answers3

0

I think you should remove ^ from request_uri

Karolis
  • 9,396
  • 29
  • 38
0

Assuming this is the same domain, you're redirecting everything to /i/page.html except /page.html. Strip out /i/page.html instead.

Denis de Bernardy
  • 75,850
  • 13
  • 131
  • 154
0

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]
anubhava
  • 761,203
  • 64
  • 569
  • 643