redirect based on internal or external IP

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

 



I am new to apache, so forgive me if this is a beginner questions.

 

I am trying to redirect request to apache based on the IP address.  Depending on where the request originates from, the request will either have a external or internal IP address.  External will be redirected to the external site, internal will be redirected to the internal site.

 

Request to www.site.com will be evaluated based on the IP address. Then redirected to either www.site.com/external or www.site.com/internal.  I am able to accomplish this with the following.

 

         RewriteCond %{REMOTE_ADDR} ^1.1.1.1

         RewriteRule ^(.*)$ www.site.com/internal [R=301,L]

 

 

         RewriteCond %{REMOTE_ADDR} ^2.2.2.2

         RewriteRule ^(.*)$ www.site.com/external [R=301,L]

 

The problem I am running into is that this is in a loop.  Every request will be evaluated and redirected.  If possible, I need a way to redirect once, then let other request (www.site.com/external/a/b/c  or www.site.com/internal/x/y/z )not be evaluated and then redirected

 

Any suggestion or help would be greatly appreciated.

 

Thanks

 

CWT2

Kim Clark | Sr. Technical Analyst, Technology

Carlson Wagonlit Travel
phone +1 763 212 3092 | fax +1 763 212 3200

701 Carlson Parkway MS 8209 | Minnetonka, MN 55305 | USA
kclark@xxxxxxxxxxxxxxxxxxx|  www.carlsonwagonlit.com

 

With offices in more than 150 countries and territories, Carlson Wagonlit Travel deploys the right people, processes, technologies and skills to consistently deliver effective travel management and bottom-line results.

 

cid:image002.png@01CC0AA4.34510120

cid:image003.png@01CC0AA4.34510120

cid:image004.png@01CC0AA4.34510120

 

 


[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