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...
Chris_Schaerli_
Nimbostratus
May 15, 2008Think I have the problem figured out. It works when I have a second elseif.
when HTTP_REQUEST {
log local0. "---------NEW REQUEST--------------"
log local0. "uri is: [HTTP::uri]"
log local0. "IP is: [IP::remote_addr]"
if { [string tolower [HTTP::path]] starts_with "/FOO" } {
log local0. "Starting uri with /FOO"
if {([IP::addr [IP::remote_addr] equals 10.12.126.248/255.255.255.255]) or
([IP::addr [IP::remote_addr] equals 10.12.126.249/255.255.255.255]) or
([IP::addr [IP::remote_addr] equals 10.12.126.250/255.255.255.255]) or
([IP::addr [IP::remote_addr] equals 10.32.186.0/255.255.252.0]) or
([IP::addr [IP::remote_addr] equals 10.34.186.0/255.255.252.0]) or
([IP::addr [IP::remote_addr] equals 10.24.69.2/255.255.255.255])
} {
log local0. "sending to pool FOO.COM"
pool FOO.COM-80
} elseif {[IP::addr [IP::remote_addr] equals 10.0.0.0/255.0.0.0] } {
log local0. "Redirecting user..."
HTTP::redirect "http://www.NEW.com"
}
} elseif {[IP::addr [IP::remote_addr] equals 10.0.0.0/255.0.0.0] } {
log local0. "Redirecting user..."
HTTP::redirect "http://www.NEW.com"
} else {
log local0. "No matched occured for this request"
}
}
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