Forum Discussion
lbeng_107406
Nimbostratus
Jan 22, 2010HTTP::redirect iRule with uri exclusion
I am trying to develop an iRule that redirects based on the HTTP user-agent but is ignored if the uri is /doc.
Can anyone assist?
software version = 9.3.1 hotfix 4
...
The_Bhattman
Nimbostratus
Jan 22, 2010Hi lbeng,
You could write up with a IF nesting the switch statement
when HTTP_REQUEST {
if { !([HTTP::uri] eq "/doc") } {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*blackberry*" -
"*windows ce*" -
"*palm*" -
"*sonyericsson*" -
"*mot-*" -
"*netfront*" -
"*nokia*" -
"*samsung*" -
"*smartphone*" -
"*symbian*" {
HTTP::redirect "http://mobile.xyz.com"
}
}
} else {
pool www.xyz.com_80
}
}
I hope this helps
Bhattman
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