Forum Discussion
andy_22730
Nimbostratus
Dec 19, 2008Use redirect and pools in same iRule?
I'm trying to build one irule that has all my logic in it, it will parse the URI of the request and send some URIs to a pool, but send others to external servers via HTTP::REDIRECT.
...
JRahm
Admin
Dec 19, 2008TCL gets a little finicky with spacing, plus, you probably want an elseif instead of an if on that second conditional. Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/foo" } {
HTTP::redirect "http://foo.com"
} elseif { [string tolower [HTTP::uri]] starts_with "/bar" } {
pool bar-pool
} else {
pool default-pool
}
}
Post back your error if this doesn't help you
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
