All pastes #288612 Raw Edit

yango

public text v1 · immutable
#288612 ·published 2006-12-22 12:51 UTC
rendered paste body
############################################################
# Help, how do i make this rule works?
# if (REMOTE_ADDR != '123.1.1.1') 
# {
#    if (REMOTE_ADDR == '123.1.*') OR
#       (REMOTE_ADDR == '123.2.*') OR
#       (REMOTE_ADDR == '123.3.*')
#    {
#       #Redirect to Localhost
#    }
# }
#------------------------------------------------
RewriteCond %{REMOTE_ADDR} !(123.1.1.1)
RewriteRule .* - [E=not123:1]

RewriteCond %{REMOTE_ADDR} (123\.1\.*) [OR]
RewriteCond %{REMOTE_ADDR} (123\.2\.*) [OR]
RewriteCond %{REMOTE_ADDR} (123\.3\.*) [OR]
RewriteRule .* - [E=yes123:1]


RewriteCond %{ENV:yes123} 1
RewriteCond %{ENV:not123} 1
RewriteRule ^(.*)\.(jpg|gif|png)$ http://localhost/$0 [R]