# Browser Detection

**URL:** <https://community.f5.com/t/browser-detection/34079>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [June 14, 2013, 12:34pm UTC](https://community.f5.com/t/browser-detection/34079 "2013-06-14T12:34:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_87636](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@Scott\_87636](https://community.f5.com/u/Scott_87636)\
**Post date:** [June 14, 2013, 12:34pm UTC](https://community.f5.com/t/browser-detection/34079/1 "2013-06-14T12:34:57Z")

</div>

Does anyone have samples of a rule to determine the Browser and version the client is using? The theory is that for a few of our applications they can only run on a certain browser(s) and its level(s). I would like to determin the browser and then decide if we will allow the F5 continue to route to the login screen or post a popup to say you are not on a supported browser etc…

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [June 14, 2013, 2:27pm UTC](https://community.f5.com/t/browser-detection/34079/2 "2013-06-14T14:27:21Z")

</div>

Perhaps something like this to start with:

```tcl
when HTTP_REQUEST {
    if { [class match [string tolower [HTTP::header User-Agent]] contains user_agent_datagroup] } {
         client user agent is in the list
        ....
    }
}

```

Then you’d create a simple string-based data group with (lowercased) User-Agent patterns that you wanted to accept.
