Forum Discussion
Joe_Pipitone
Nimbostratus
Feb 14, 2011using HTTP::host with 2 hostnames
This iRule triggers an error in the F5 log: "TCL error: irule-test HTTP_REQUEST - cant use non-numeric string as operand of - while executing if {[string tolower [HTTP::host]] eq www.oneofourdomains.c...
hoolio
Cirrostratus
Feb 14, 2011switch accepts the hyphen syntax to use the same action for multiple string patterns. 'if' does not. You could use another switch nested in the first switch to do this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/events/a-company-event-2010*" {
HTTP::redirect "http://oneofourdomains.com/Events/event-2011"
}
default {
switch [string tolower [HTTP::host]] {
"www. oneofourdomains.com" -
"www. adifferentone.com" -
"adifferentone.com" {
HTTP::redirect "http://oneofourdomains.com[HTTP::uri]"
}
}
}
}
} Aaron
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
