Forum Discussion
Nick_Coelho_338
Nimbostratus
Mar 03, 2007iRule works but getting browser error, help!
need an iRule that looks for trafficui and gives pool but if it does not see trafficui it looks for the hostname and redirects
it seems to work but i get errors on the "test1.com" links. bet...
Mar 04, 2007
At first glance, it looks good to me (besides the double slash in the "www.test1" and www.test2 redirects - unless this is what you intended). What kind of errors are you getting?
Here's an example of using a switch statement for your reference (with test1* and www.test1* redirecting to the same uri).
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/TrafficUI" } {
pool Testy
} else {
switch -glob { [HTTP::host] } {
"test1*" -
"www.test1*" {
HTTP::redirect "http://www.test1.com/TrafficUI/mscui/page.aspx?cid=1&ptid=5"
}
"test2*" -
"www.test2*" {
HTTP::redirect "http://www.test2.com/TrafficUI/mscui/page.aspx?cid=1&ptid=10"
}
"test*" {
HTTP::redirect "http://www.google.com/"
}
}
}
}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