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 14, 2008Hi Chris,
You can wrap all the logic in the HTTP_REQUEST event in an 'if' statement which checks the path. You basically have it listed in your post above. I'm not sure whether you want to match on the full URI matching /portal/site exactly, the path matching /portal/site exactly or the path starting with /portal/site. Here's an example which checks if the path is exactly /portal/site/.
when HTTP_REQUEST {
if {[HTTP::path] eq "/portl/site/"}
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