Forum Discussion

Thomas_Scot_G_3's avatar
Thomas_Scot_G_3
Icon for Nimbostratus rankNimbostratus
Nov 14, 2017

iRule with User Agent to allow iphone and android, but block all other user agent.

We would like to limit external traffic coming to our portal via F5 to mobile devices only. It should allow PC / Laptop traffic redirect towards another url. I tried the below I rule but always redirecting to the url specified even for mobile users

when HTTP_REQUEST { if { ![class match [string tolower [HTTP::header "User-Agent"]] contains Mobile_Access_Only ] } { continue

} else {
    HTTP::redirect "http://xxxx/"
}

}

Can someone help on this.

2 Replies

  • Looking at your comment, you should not negate if condition. You may log user-agent values for verification.

     

  • Hi, I realize you may be here looking for a free fix but my company, ScientiaMobile, offers device intelligence tools that focus on UA parsing. If a fully functional and weekly updated UA parsing service is possibly required for your project please read on.

     

    We track hundreds of millions of user agents and accurately map those to about 60,000 devices currently, and every device is mapped to over 500 data points which helps in making rendering decisions. Facebook, Google, Akamai, PayPal, and many other large companies use us as their device recognition engine.

     

    We track hardware type (phone, tablet, pc, tv, etc), brand, model, marketing name, OS, OS version, screen size, everything you'd need to know to accurately detect, measure, and treat devices on the web.

     

    If you'd be up for a quick conversation shoot me an email at jon@scientiamobile.com