Forum Moderators: phranque
I think it should looke something like this
RewriteCond %{REMOTE_ADDR} ^[0-9][0-9][0-9].[0-9][0-9][0-9].[0-9][0-9][0-9].[0-9][0-9][0-9] [AND]
RewriteCond %{REMOTE_ADDR} ^255.255.255.255 [AND]
RewriteCond %{REQUEST_URI} !^/images/
RewriteRule .* http://www.example.com/test/
There are a few things I want it to check. The first rewritecond should look for all ranges. The second rewritecond should be negative though, so if someone comes from 255.255.255.255, it shouldn't do the rule for him. (like!= in java or javascript). The rule should rewrite anyone trying to go to the images dir and every subdir underneath it. It should rewrite to http://www.example.com/test/.
One more cool thing would be if I could add a condition that said that if they went to a specific file under that dir (or subdir) they wouldn't be rewrited. Thanks :)
[edited by: jdMorgan at 2:35 am (utc) on June 8, 2005]
[edit reason] examplified [/edit]
If so, you're probably looking for something like this:
RewriteCond %{REMOTE_ADDR} !^10.1.1.1 [AND]
RewriteCond %{REQUEST_URI} ^/images/ [AND]
RewriteCond %{REQUEST_URI} ~^/images/one_special_page.html
RewriteRule .* http://www.example.com/test/
[edited by: jdMorgan at 2:34 am (utc) on June 8, 2005]
[edit reason] examplified [/edit]
Also, it can be simplified down to two lines:
# redirect requests for /images folders and files unless from my IP address
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.1$
RewriteRule ^images/ http://www.example.com/test/ [R=301,L]
Jim