Forum Discussion
jrok_47156
Nimbostratus
Aug 30, 2012HTTP::uri equality question
This may be a very simple question but I have looked for a few hours now and cannot find a good answer.
Why does this work?
switch [HTTP::uri] {
"/maintenance" { ...
Michael_Yates
Nimbostratus
Aug 30, 2012Yes, that will work, but it's an absolute search.
So if somone went to http://www.website.com/maintenance/index.html or anything after "/maintenance" the iRule would not work.
I would suggest using "starts_with" so that it would basically be http://www.website.com/maintenance(anyting you could possibly put after it to qualify for this action).
Strange that you had to remove the switch statement. In a switch statement you have to enabe the "-glob" in order to use Wildcards to basically compensate for not having the starts_with or ends_with options.
switch -glob [ string tolower [HTTP::uri]] {
"*/maintenance" { action } <- Compensates for "starts_with"
"/maintenance*" { action } <- Compensates for "ends_with"
Hope this helps.
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