Forum Discussion
muzammil_88686
Nimbostratus
Nov 22, 2012Detecting Mobile Devices and Redirecting to different URL
Dear Dev Team,
-> Curretly we have the below iRule.
==========================================================
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] ...
What_Lies_Bene1
Cirrostratus
Nov 22, 2012Create a Data Group with the relevant mobile User Agent strings call 'user-agent-dg' and then update your iRule as follows;
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www.test.com" -
"test.com" -
"10.1.1.1" {
Check and redirect request
switch [string tolower [HTTP::path]] {
"/" -
"/abc/123" {
if { [class match [string tolower [HTTP::header User-Agent]] contains user-agent-dg ] } {
HTTP::redirect "http://www.test.com/abc/123/mypage/mobile-page" }
else {
HTTP::redirect "http://www.test.com/abc/123/mypage/?reset=true" }
}
}
}
}
}
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