Forum Discussion
Chris_Minnich_1
Nimbostratus
Mar 27, 2007URL based redirect...
Hello...
I have 3 instances where I need certain URL's to be directed to a specific pool (the same pool), http://websitename/calendar, http://websitename/cgi-bin and http://websitename/smd/studen...
Mar 27, 2007
That should work for you, but you are doing a separate string allocation in each of the if/elseif's. If I were you, I'd go with the switch route (just my own preference. And since, you are using the same case for each of the conditions, a switch is extra-easy to read. Either way should work for you though. You pick what is easier for you to maintain.
Here's the switch version of your iRule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/calendar*" -
"/smd/student/2008*" -
"/cgi-bin*" {
pool URMCPublicExclusion_HTTP_Pool
}
}
}The -glob argument is for file-type globbing (wildcards).
You can check out the syntax for the switch statement here:
http://tmml.sourceforge.net/doc/tcl/switch.html
Click hereAnd, yes, if none of the conditions are met, it will default to the default pool assigned to the virtual server.
-Joe
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
