Forum Discussion
Parveez_70209
Nimbostratus
Jul 31, 2014Use of switch -glob statement to switch the traffic in place of if or elseif statement in Irule
Hi Sir,
Wanted to make efficient use of switch -glob statement to switch the traffic in place of if or elseif statement: Kindly guide how the Irule looks like.
when HTTP_REQUEST {
log local...
nathe
Cirrocumulus
Aug 01, 2014I've amended slightly, including string tolower and removing some of the lines. hope this is what you're after.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/" {
HTTP::redirect "http://[HTTP::host]/SEUILibrary/controller/Lenovo:Enter"
log local0. "redirecting to http://www.lenovo.com/us/en"
}
"/console" -
"*/login.workflow:enter*" -
"*:sitestatus*" -
"*/seapibroker*" -
"*/author" {
HTTP::redirect "http://canadauat.leni2.com"
}
default {
HTTP::redirect "http://somewhere.anywhere.com/last/resort.aspx"
}
}
}
Hope this helps.
N
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