Forum Discussion
Mark_S__182830
Jan 15, 2015Nimbostratus
Adding Catchall Behavior to iRule
With the following iRule, when I hit domain.com/ShortName1_Anything here, it will keep the URI portion intact and pass it to the default pool for the VIP. if { [HTTP::uri] eq "/ShortName1*" } {...
Michael_Jenkins
Jan 15, 2015Cirrostratus
I think the issue is with your
*
in your if statement. Try this instead...
switch -glob -- [string tolower [HTTP::uri]] {
"/shortname1*" {
Do nothing
}
"/blah/shortname*" {
HTTP::uri "/ShortName1"
pool CUSTOM_POOL2
}
default {
HTTP::redirect "/ShortName1"
If you perform the redirect there's no reason to set the pool, because the client will redirect.
}
}
Of course, you can make changes like if you need to maintain the original URI after the /shortname or if you want to add more options.
Hope this helps
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