RE: Using Rewrite rules to force all requests to a specific page except those comming from curtain IP addresses:

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

 



Hi Joshua,

Thanks for the prompt response - the intention is to allow those ip's listed
to NOT be redirected, but all others to be redirected. What actually happens
is that no ip is redirected.

I'll configure the rewrite log as suggested to see what this throws up.

Thanks

Simon.

> -----Original Message-----
> From: jslive@xxxxxxxxx [mailto:jslive@xxxxxxxxx] On Behalf Of Joshua Slive
> Sent: 29 May 2007 19:14
> To: users@xxxxxxxxxxxxxxxx
> Subject: Re:  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@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 
> 
> --
> 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@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