httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Billis" <si...@houxou.com>
Subject RE: [users@httpd] Using Rewrite rules to force all requests to a specific page except those comming from curtain IP addresses:
Date Tue, 29 May 2007 18:44:14 GMT
Hi Folks,

Further to my last post I have followed the suggestion to log the rewrite
and I have found the following:

192.168.244.105 - - [29/May/2007:19:33:26 +0100]
[dev.mydomain.com/sid#89cf438][rid#8c496a8/initial] (4) RewriteCond:
input='192.168.244.247' pattern='^!192\.168\.244\.247$' => not-matched
192.168.244.105 - - [29/May/2007:19:33:26 +0100]
[dev.mydomain.com/sid#89cf438][rid#8c496a8/initial] (4) RewriteCond:
input='192.168.244.247' pattern='^!192\.168\.245\.245$' => not-matched
192.168.244.105 - - [29/May/2007:19:33:26 +0100] 
[dev.mydomain.com/sid#89cf438][rid#8c496a8/initial] (1) pass through /
192.168.244.105 - - [29/May/2007:19:33:26 +0100]
[dev.mydomain.com/sid#89cf438][rid#8c4f6c0/subreq] (2) init rewrite engine
with requested uri /index.php
193.203.244.105 - - [29/May/2007:19:33:26 +0100]
[dev.mydomain.com/sid#89cf438][rid#8c4f6c0/subreq] (1) pass through
/index.php


Form the above it appears that "RewriteCond %{REMOTE_ADDR}
^!192\.168\.244\.105$" is not being triggered. Have I got the syntax
incorrect or is the ! not supported for this?


Thanks

Simon.

> -----Original Message-----
> From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
> Sent: 29 May 2007 19:14
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite rules to force all requests to a
> specific page except those comming from curtain IP addresses:
> 
> On 5/29/07, Simon Billis <simon@houxou.com> wrote:
> > Dear All,
> >
> > I am attempting to force all requests to any url at www.mydomain.com to
> be
> > rewritten to http://www.mydomain.com/maintenance.php except for requests
> > made from specific IP addresses.
> >
> > I thought that if I added the following that this would work as
> intended:
> >
> > RewriteEngine   on
> > RewriteCond %{REMOTE_ADDR} ^!192\.168\.244\.247$ [OR]
> > RewriteCond %{REMOTE_ADDR} ^!192\.168\.245\.245$
> > RewriteRule ^/.*$      http://www.mydomain.com/maintenance.php [R]
> >
> > I think that I may be barking up the wrong tree - any pointers would be
> > gratefully received.
> 
> [You haven't told us what happened when you tried this config. But I
> think I can guess. I addition, the problem would have been clear if
> you had used the RewriteLog.]
> 
> Remove the [OR]. Since all requests will be (Not .247 OR Not .245),
> the RewriteRule will always be applied.
> 
> Joshua.
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message