Forum Discussion
nrg2brn_163859
Nimbostratus
Mar 10, 2015I just did my first (pool switching) irule, now they threw me a curve ball.
I was feeling pretty good with my little irule that, depending on the first few letters of the uri would switch pools:
when HTTP_REQUEST {
Check the requested path with wildcard matching
...
StephanManthey
Nacreous
Mar 10, 2015Hi Dave,
an iRule to handle this request would look like this:
when HTTP_REQUEST {
if {([string tolower [HTTP::host]] equals "ecms.epa.gov") and
(([string tolower [HTTP::path]] equals "/erma/login.htm") and
([string tolower [HTTP::query]] contains "action=search"))} {
HTTP::redirect "http://ecms.epa.gov/erma2/login.htm?action=search"
return
}
}
It will check the host-header, the path and the query (URI includes path and query separated by question mark).
For a match it will redirect the client.
In case of no match it will proceed and end up with the default action i.e. leaving it to the virtual server to forward to the default pool.
Thanks, Stephan
2015-03-11: Edited according to Arie´s advice.
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