# iRULE difference between strong tolower

**URL:** <https://community.f5.com/t/irule-difference-between-strong-tolower/32994>\
**Category:** Technical Forums\
**Tags:** irules, big-ip, security\
**Created:** [February 22, 2017, 2:43pm UTC](https://community.f5.com/t/irule-difference-between-strong-tolower/32994 "2017-02-22T14:43:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![falooda\_281506](https://avatars.discourse-cdn.com/v4/letter/f/b5ac83/32.png) [@falooda\_281506](https://community.f5.com/u/falooda_281506)\
**Post date:** [February 22, 2017, 2:43pm UTC](https://community.f5.com/t/irule-difference-between-strong-tolower/32994/1 "2017-02-22T14:43:10Z")

</div>

What is the difference between both iRule usuage, and when is best to use this:

elseif {[HTTP::uri] contains “/testweb/” {pool TESTweb}

elseif {[string tolower [HTTP::uri]] contains “/testweb/” {pool TESTweb}

---

<div class="post-metadata">

**Author:** ![Niels\_van\_Sluis](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/niels_van_sluis/32/3759_2.png) [@Niels\_van\_Sluis](https://community.f5.com/u/Niels_van_Sluis)\
**Post date:** [February 22, 2017, 3:40pm UTC](https://community.f5.com/t/irule-difference-between-strong-tolower/32994/2 "2017-02-22T15:40:29Z")

</div>

I would prefer the second one. The tolower command will convert all characters in HTTP:uri to lowercase characters before it is compared to ‘/testweb/’. This will cause variations like ‘/tEstWeb/’ to also match.

---

<div class="post-metadata">

**Author:** ![Kai\_Wilke](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kai_wilke/32/24646_2.png) [@Kai\_Wilke](https://community.f5.com/u/Kai_Wilke)\
**Post date:** [February 22, 2017, 5:52pm UTC](https://community.f5.com/t/irule-difference-between-strong-tolower/32994/3 "2017-02-22T17:52:14Z")

</div>

Hi falooda,

the

```tcl
[string tolower [HTTP::uri]]

```

syntax is the recommended approach, if a human is intended to type the URL into the address bar. In addition, this command is also recommended if you implement certain security controls (e.g. blacklists) and you want to make sure that a different /CaSE can not be used to bypass the policy…

```tcl
The user/attacker may enter:

https://www.domain.de/shorturl
https://www.domain.de/Shorturl
https://www.domain.de/ShortUrl
https://www.domain.de/SHORTURL

```

Your first iRule snippet will trigger only on the first example. And your second iRule snippet will trigger in any of the above URL examples.

Cheers, Kai
