Forum Discussion

Algebraic_Mirror's avatar
Algebraic_Mirror
Icon for Cirrostratus rankCirrostratus
Dec 20, 2019

LTM Rewrite Profile - Is there any way to make the matching case-insensitive?

Is there any way to make the LTM Rewrite Profile case insensitive when it does matching? I am using a rewrite profile based on rewrite-uri-translation to do very simple remapping of external directories to internal servers/directories, and it is running in URI-Translation mode, not Portal mode. This scenario is similar to Apache mod_proxy/mod_rewrite functionality, and F5 recommends using a combination of the LTM Traffic Policy and the Rewrite Profile to do this.

 

However, I'm running into a case sensitivity problem. In Apache, the NC (no-case) flag is nearly always used to provide for case insensitive matching of rewrite rules, and rules from mod_proxy like ProxyPassReverse seem to be by default case insensitive. Similarly, the LTM Traffic Policy is by default case insensitive when it comes to the conditions inside policy rules such as matching URI paths.

 

But unfortunately, the LTM Rewrite Profile is case sensitive, and worse, I can't seem to find any way to turn it off. So a rewrite rule that is supposed to rewrite requests for paths starting with /example/, would not match if the user sent in a path starting with /ExAmPle/.

 

 

What I Am Looking For In An Answer:

  1. I am looking for a definite answer as to how you turn off case sensitivity in the rewrite profile.
  2. Alternatively, an answer saying it is not possible is acceptable, as long as it has somehow been confirmed to be true.
  3. I'm not looking for iRules or other ways to do this. I know there are other ways to do this, but I would really like to see if this way is possible first, because it would be by far the easiest way for my end users (who aren't necessarily coders or iRule masters) to maintain.
  • I recently ran into the same situation.

     

    A customer asked for a -nocase clientside REWRITE to a highly MiXed- and strickly cAse-SenSitiVe serverside.

     

    I ended up attaching a RULE_INIT iRule to each VS holding an abstracted syntax how the REWRITE should look like.

     

    Deployed in the background a iCall script to read the abstracted syntax out of those iRules on each saving to recalculate the required REWRITE profile and to construct a [string map -nocase] replace list for a rather simple HTTP_REQUEST iRule to allign the case of the clientside path portion.

     

    Pretty overkill, but in the end it has worked out and was also easier to maintain than a usual REWITE profile... ;-)

     

    Cheers, Kai

  • M_2's avatar
    M_2
    Icon for Altocumulus rankAltocumulus

    you can convert them with string tolower or string toupper as required ..

     

    • Algebraic_Mirror's avatar
      Algebraic_Mirror
      Icon for Cirrostratus rankCirrostratus

      Can you please provide more information about what you are suggesting? The rewrite profile is a GUI feature, so are you saying you can put iRule commands into the fields in the GUI or something?