Interesting IP redirect question

Interesting IP redirect question

Post by sbr.. » Fri, 11 Dec 1998 04:00:00



I'm using Apache 1.2.6 and want to redirect everyone except 4-5 IP
addresses.

In other words I only want a few specific IP addresses to be able to
access my main virtual site while sending all others to a secondary
virtual site on the same box.

Any help would be greatly appreciated.

Please also copy me via email, as I might miss your post.

Thanks,

Strom

 
 
 

Interesting IP redirect question

Post by Ralf S. Engelschal » Sun, 13 Dec 1998 04:00:00



> I'm using Apache 1.2.6 and want to redirect everyone except 4-5 IP
> addresses.
> In other words I only want a few specific IP addresses to be able to
> access my main virtual site while sending all others to a secondary
> virtual site on the same box.

Assuming your IPs are 1.2.3.4 - 1.2.3.8 you can use:

  Rewri*gine on
  RewriteCond   %{REMOTE_ADDR} ^1\.2\.3\.[4-8]$
  RewriteRule   ^/(.*)         http://other-vhost/$1 [R,L]

                                       Ralf S. Engelschall

                                       www.engelschall.com