Forum Discussion
Brent_Sachnoff_
Nimbostratus
Oct 23, 2007Using switch with uri
I'm having some issues using the switch command and uri's. I believe the switch command is only for EQUALS to something for it to work properly which means this wouldn't work at all. Here is a sample...
John_48565
Nimbostratus
Oct 30, 2007Can this take the place of an if else irule? I want to use a wildcard so that anything after /virtualdir/default/* goes to Pool_1 and then anything after /virtualdir/second/* goes to Pool_2
when HTTP_REQUEST {
if { [HTTP::uri] contains "/virtualdir/default"}{pool Pool_1}
elseif
{[HTTP::uri] contains "/virtualdir/second/viewproducts" or [HTTP::uri] contains "/virtualdir/second/ordersummary" or [HTTP::uri] contains "/virtualdir/second/billing" or [HTTP::uri] contains "/virtualdir/second/paybypaypal"}{pool Pool_2}}
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/virtualdir/second/*" { pool Pool_2 }
default {
pool Pool_1
}
}
}
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