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
Michael_Yates
Jul 20, 2011Nimbostratus
There was no process handling for the event in Colin's post and there was a rogue "-" in mine.
This one will redirect for blackberry or ipad, and log the User-Agent any other devices.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*blackberry*" -
"*ipad*" {
HTTP::redirect "http://m.mysite.com/[HTTP::uri]"
return
}
default { log local0. "Device Access Attempt [HTTP::header User-Agent]" }
}
}
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