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...
Colin_Walker_12
May 14, 2008Historic F5 Account
Here's a slightly cleaned up version. The logic looks correct. I'm not sure why requests would be falling through assuming you have the path and IP correct in the request. Have you tried adding some logging statements to see what values are coming through in your request packets?
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] eq "/foo/"} {
switch [IP::addr [IP::remote_addr]] {
10.12.126.248/255.255.255.255 -
10.12.126.249/255.255.255.255 -
10.12.126.250/255.255.255.255 -
10.24.69.2/255.255.255.255 -
default {
pool FOO.com-80
}
}
} elseif {[IP::addr [IP::remote_addr] equals 10.0.0.0/255.0.0.0] } {
HTTP::redirect "http://www.NEW.com"}
}
}
Colin
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