Forum Discussion
Vaughn_96017
Nimbostratus
Jun 27, 2007Redirect based on user browser (mobile)
I am writing an iRule that states if the user is coming in via a mobile device to get redirected to a different pool. My question, here is what I have, is this correct?
when HTTP_REQUEST {
...
Wil_Schultz_101
Nimbostratus
Jul 02, 2007Wow, that's a fairly extensive list 🙂
The list we have seems to work for us, to be honest we actually get complaints because a lot of "Smart Phones" are able to render sites just fine and they don't want to use the mobile page. (See the bypass below)
So creating the iRule would look like the above, here is a version with some of them:
switch -glob [HTTP::header User-Agent] {
"*BlackBerry*" -
"*UP.Browser*" -
"*(GUI)*" -
"*AUDIOVOX*" -
"*AU-MIC,*" -
"*Alcatel*" -
"*BlackBerry*" -
"*BENQ*" {
pool mobile_pool
}
} Here is the bypass mechanism, which also explains the original if statement:
if {!([string tolower [HTTP::host]] == "mobilebypass.my.com")} {
switch -glob [HTTP::header User-Agent] {
"*BlackBerry*" -
"*UP.Browser*" -
"*(GUI)*" -
"*AUDIOVOX*" -
"*AU-MIC,*" -
"*Alcatel*" -
"*BlackBerry*" -
"*BENQ*" {
pool mobile_pool
}
}
}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
