Mixed case compares ?

What is the best syntax to compare uri’s in a mixed case environment.

I want to use something along the lines of:

if (http_uri starts_with “/cccard/public/en/ApplyNow”)

redirect to “https:/%h/%u”

Where the A in apply and N in now could be either upper or lower case.

Thanks.

Kphi,

What distribution of the 4.x code are you running on your BigIP? The practices for this vary slightly depending on which release you’re on.

Thanks,

-Colin

Currently 4.6.2, but we are trying to get to 4.6.4

Kphi,

To do this in the 4.6.1 and later branch, you’d use the “tolower” command, which we made available as of 4.6.1.

We have a solution about it on askf5.com here:

Click here http://tech.f5.com/home/bigip/solutions/lb/sol2796.html

Basically, the syntax looks like this:

rule WhateverCase {
  if (tolower(http_uri) ends_with "jpg") {
    use pool web
  } else {
    use pool web1
  }
}

Whenever performing a string comparison while using the tolower command, it will treat everything as lowercase, so you should be set.

Hope this helps,

-Colin

Exactly what I was looking for. Thanks.