Re: [users@httpd] rewrite only for certain originating IPs

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

 



On 11/20/05, Prabhat Kumar (IT) <pkumar@xxxxxxxxxxxxxxxxxxx> wrote:

> I have a simple rewrite rule that sends requests meant for one domain to
> another. Is there a way to only perform this redirection for only a certain
> originating IP? There will probably be a list of 10 IPs for which this
> redirection will have to be performed.

You'll need to spend some quality time with the mod_rewrite docs.  A
sketch of the solution is

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^123\.346\.789\.1$ [OR]
RewriteCond %{REMOTE_ADDR} ^123\.456\.789\.2$
RewriteRule (.*) http://otherdomain.example.com$1 [R]

Be sure to use the RewriteLog to debug.

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



[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