Forum Moderators: phranque
...there is additional syntax available to perform other useful tests against the Teststring:
1. You can prefix the pattern string with a '!' character (exclamation mark) to negate the result of the condition, no matter what kind of CondPattern is used.
2. You can perform lexicographical string comparisons:
...
=CondPattern
Lexicographically equal
Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString is lexicographically equal to CondPattern (the two strings are exactly equal, character for character). If CondPattern is "" (two quotation marks) this compares TestString to the empty string.
RewriteEngine On
RewriteCond {HTTP_REFERER} thisandthat
RewriteCond {REMOTE_ADDR} !^111.222.333.444
RewriteRule ....
RewriteEngine On
RewriteCond {HTTP_REFERER} thisandthat [OR]
RewriteCond {HTTP_REFERER} morestuff
RewriteCond {REMOTE_ADDR} !^111.222.333.444
RewriteRule .... RewriteEngine On
RewriteCond {HTTP_REFERER} thisandthat
RewriteCond {REMOTE_ADDR} !^111.222.333.444
RewriteRule .... Exactly what happens when I come in using any other IPBe more explicit. What happens? And what is your last line exactly?
RewriteEngine On
RewriteCond %{HTTP_REFERER} thisandthat
RewriteCond %{REMOTE_ADDR} !^111\.222\.2333\.444
RewriteRule - [F]
(with the escapes mentioned earlier) RewriteEngine On
RewriteCond {HTTP_REFERER} thisandthat
RewriteCond {REMOTE_ADDR} !^111.222.333.444
RewriteRule ^onefile\.htm anotherfile.htm [R=302,L] Is it absolutely necessary that this IP is exempted from the redirect? Sometimes keeping things simple is the best approach.