[users@httpd] mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have an interesting dilemma that I need to figure out a solution to.
I hope someone on this list can help me.

I have Apache running on a Linux server.  I need to change the document
root based on source IP address.  I have this working and it works very
well.  Now, with the nature of a couple of our subnets I'm not sure how
to go about it.  This is one that is working:

RewriteEngine on
RewriteCond %{REMOTE_ADDR} (^10\.10\.41\.[0-9]|^10\.10\.49\.[0-9])
RewriteRule ^(.*) /blocked/$1
RewriteCond %{REMOTE_ADDR} (!^10\.10\.41\.[0-9]|!^10\.10\.49\.[0-9])
RewriteRule ^/blocked/(.*) /$1

I'm able to do this because we have allocated a /23 (255.255.254) as the
subnet mask which would give us: 10.10.40.1 - 10.10.41.254) for
addresses.  Now 10.10.41.0 - 10.10.41.254 is known as our "quarantine"
network and therefore they get a different website.  Like I said this
works!!  

Now, my BIG dilemma is this:

We have a couple subnets that are strictly a /24 (255.255.255.0) and
needless to say they both are right next to each other.  So, what we
have done is 10.10.224.1 - 10.10.224.127 is our registration network and
10.10.224.128 - 10.10.224.254 is the "quarantine" network.  

So, here is my question.

How would I make apache change the document root for 10.10.224.128 -
10.10.224.254 to the blocked location but if you have a source IP of
10.10.224.56 then you would get the registration page which is located
in /var/www/html??

I know this is confusing - if there is any questions please let me know.

Any help in this would be greatly appreciated.

Many thanks in advance!!

**************************
David J. Lucas
UNH Telecommunications
Phone: (603) 862-7373
GSDLN and NEAT Customers Dial (603) 862-VIEW  



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux