Forum Discussion

Pandiarajan_701's avatar
Pandiarajan_701
Icon for Nimbostratus rankNimbostratus
Jun 23, 2014

Need Help with the I-Rule Data Group List

Hi All,

 

Need you advise on one of the requirement which has been raised by our application team. Currently we have the services running on our LTM for the portal site. We have the data group list configured with the string records for the Mobiles android, bb10, blackberry, iphone, lg..... etc and will be redirected to the URL for mobiles. Now the application team is requesting us to seperate the above 7" Inch devices as non mobile device and should not be redirected. Could someone can help us in fine tuning this iRule or changing the string in the Data Group list.

 

IRule:

 

if { [HTTP::uri] equals "/" } { if { [class match [string tolower [HTTP::header User-Agent]] contains mob_dev_dg] } { HTTP::redirect "http://www.raju.com.sa/eee/portal/mobile" log local0. "[IP::client_addr]:[TCP::client_port]: UA: [HTTP::header User-Agent], Mobile Device Detected"

 

1 Reply

  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    For Firefox on Android may be you can looks for keyword "Tablet' in user agent.

     

    Mozilla/5.0 (Android; Tablet; rv:13.0) Gecko/13.0 Firefox/13.0

     

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference

     

    For Safari on iOS you can look for "iPad"

     

    Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/30.0.1599.12 Mobile/11A465 Safari/8536.25

     

    http://www.webapps-online.com/online-tools/user-agent-strings/dv/operatingsystem51849/ios

     

    So, there is no fixed useragent format. Need build the repository. But if the mobile device types are controlled in your environment it will be easier to build it.