Forum Discussion
Joseph_Johnson_
Feb 27, 2015Nimbostratus
iRule redirect to mobile site
Hi,
I'm trying to create an iRule that will redirect users to site "www.mobilesite.com/slm/faces/m/index.jspx" if on mobile device else redirect to "https://mysite.com/OLA/faces/siteLocator.jspx"....
Ashish_Ram_Tak1
Feb 27, 2015Nimbostratus
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri] ]
set mobile_site "https://www.mobilesite.com"
set full_site "http://www.mobilesite.com?Ismain=true"
if {$uri contains "ismain=true" || $uri contains "xyzuri" || $uri contains "dynamicweb"} {
event disable
} else {
switch -glob [string tolower [HTTP::header User-Agent]] {
"iphone" -
"android" -
"windows phone" -
"*windows ce*" -
"*bada*" -
"bb10" -
"blackberry" -
"symbinos" -
"symbain os" -
"symbian" -
"java" -
"winowsphone" -
"*windowsce*" {
HTTP::redirect "https://www.mobilesite.com"
return
}
}
}
}
- Ashish_Ram_Tak1Feb 27, 2015NimbostratusPlease try this iRule
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