httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [users@httpd] redirection based on client IP address (only first two octets)
Date Mon, 18 Nov 2002 16:09:24 GMT
Hi All,
I have the following REWRITE rules to redirect based upon client IP
address. The redirection works fine. However now I want to redirect based
on only first 2 octets of the IP address. e.g:

10.4.*.* should be redirected to
10.26.*.* should be redirected to
10.5 should be redirected
 so on and so forth.

I am not able to figure out how to do this. Can anyone help me out here.

file: httpd.conf
RewriteMap  redirector txt:/tmp/
RewriteCond ${redirector:%{REMOTE_ADDR}|NO-REDIRECT} !=NO-REDIRECT
RewriteRule ^.* ${redirector:%{REMOTE_ADDR}} [R,L]

[root@xml saqib]# vi /tmp/
....          ...

Saqib Ali

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message