httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah <>
Subject Re: [users@httpd] mod_rewrite
Date Fri, 29 Jul 2005 17:47:49 GMT
On Fri, Jul 29, 2005 at 12:49:00PM -0400, Lucas, David wrote:
> 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


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

The following regex which match -

^10\.10\.224\.(1(2[89]|[3-9][0-9])|2([0-4][0-9]|5[0-4]))$ that more or less what you needed?


Neil! Your bed's on fire!

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