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
when HTTP_REQUEST {
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
}
}
- The_Bhattman
Nimbostratus
Hi lbeng,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 } }
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