Forum Discussion
Joe_Pipitone
Nimbostratus
Oct 05, 2010Trouble with switch statements and multiple http::host and http::uri
Good morning all, I've scripted an iRule in hopes of being able to consolidate multiple rules together. This rule is supposed to check the host, check the uri, and evaluate both, and redirect whe...
Joel_Moses
Nimbostratus
Oct 05, 2010No need to have two switch statements checking HTTP::host. You could try something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"events.oursite.com" {
switch -glob [string tolower [HTTP::uri]] {
"/eventpage.aspx?event=something08" {
HTTP::redirect "http://redirecteddomain.com"
}
}
}
"adifferentsite.com" {
switch -glob [string tolower [HTTP::uri]] {
"/presentations*" {
HTTP::redirect "http://some.site.com/information/download-resources.aspx"
}
}
}
}
}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
