Forum Discussion
soymanue
Nimbostratus
Apr 20, 2013Regexp question
I want to build and iRule witch "SWITCH" command to make an URI based redirection.
If we have http://www.mydomain.com/URI y would need to redirect this way
if URI is "/marketing" or ...
Kevin_Stewart
Employee
Apr 20, 2013You don't even need a regex for something like this. Just use the -glob option of the switch command:
switch -glob [string tolower [HTTP::uri]] {
"/marketing*" { pool marketing_pool }
"/accounting*" { pool accounting_pool }
"/humanresources*" { pool hr_pool }
default { pool default_pool }
}
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
