Forum Discussion
reldar_76465
Jul 13, 2011Nimbostratus
redirect 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
hooleylist
Jul 21, 2011Cirrostratus
One 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
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