Forum Discussion
Chris_Schaerli_
Nimbostratus
May 12, 2008Redirect or rewrite?
Hi,
I am trying to setup something to direct traffic based on source IP. We are rolling out an application and we want to do it in phased approach.
This is wha...
hoolio
Cirrostratus
May 13, 2008Hi Chris,
I think you need two different iRules for this. It looks like on the HTTP VIP, you want to redirect specific clients to HTTPS and send the rest to the pool. On the HTTSP VIP, you want to redirect some clients and send the rest to the pool. The syntax you're using for the IP address comparisons and redirects is fine. To send the request to the pool, you can either specify it using the 'pool' command, or just configure a default pool on the VIP and don't specify any action in the iRule. Here's an example for the HTTP VIP:
when HTTP_REQUEST {
if { [IP::addr [IP::remote_addr] equals 10.32.186.0/255.255.252.0] } {
Redirect from the HTTP VIP to the HTTPS VIP
HTTP::redirect “https://site.com/portal/site/NEW"
} elseif {[IP::addr [IP::remote_addr] equals 10.0.0.0/255.0.0.0] } {
Redirect from the HTTP VIP to the HTTPS VIP
HTTP::redirect "https://site.com/portal/site/OLD"
} elseif {[IP::addr [IP::remote_addr] equals 10.20.20.0/255.255.252.0] } {
Use the HTTP pool for this request. Or remove this line and the request will go to the default pool on the VIP
pool http_pool
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects