Forum Moderators: phranque
However, I ask kindly if you could help me with the following. How would I redirect everyone in a certain dir and all it's subdirectories, but one IP. That would be my IP. Is that possible?
Appreciate all input! Thanks
Welcome to WebmasterWorld!
You could use mod_rewrite's RewriteCond and RewriteRule directives to do this in two to four lines of code. We don't write code on request here, but our forum charter [webmasterworld.com] provides links to some basic references.
Jim
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 .* [whatever.com...]
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. The rule should rewrite anyone trying to go to the images dir and every subdir underneath it. It should rewrite to [whatever.com...]
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 :)