Forum Discussion
reldar_76465
Nimbostratus
Jul 13, 2011redirect mobile devices
Hi,
I'm looking for a script that will enable us to redirect all traffic coming from mobile devices to a mobile site.
Many thanks for the help.
Roy
hoolio
Cirrostratus
Jul 21, 2011One tiny suggestion:
You can remove the / in the redirect between the hostname and [HTTP::uri]:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*blackberry*" -
"*ipad*" {
HTTP::redirect "http://m.mysite.com[HTTP::uri]"
}
default { log local0. "Device Access Attempt [HTTP::header User-Agent]" }
}
}
Also, you don't need the return in the switch statement as only one switch case will ever get executed.
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
