Forum Discussion
Thamer_3789
Nimbostratus
Sep 23, 2012mobile device redirection
Hi All;
i want to apply this iRule to redirect the mobile devices traffic to another web site by detecting the "user agent" header...may you check it guys !!!!
when HTTP_REQUEST {
if { [string tolower [HTTP::host][HTTP::uri]] contains "www.mysite.com" } {
if { [class match [string tolower [HTTP::header User-Agent]] equals mobile_device_types ] }{
HTTP::redirect "http://m.mysite.com"}
}
}
* Where " mobile_device_types " is a data group ...
Thanks in advanced
- nathe
Cirrocumulus
Thamer, - hoolio
Cirrostratus
As Nathan said, maybe something like this:when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "www.mysite.com" } { if { [class match [string tolower [HTTP::header User-Agent]] contains mobile_device_types ] }{ HTTP::redirect "http://m.mysite.com" } } }
- Thamer_3789
Nimbostratus
Thanks Guys :)
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