Forum Discussion

SteveEason_3059's avatar
SteveEason_3059
Icon for Nimbostratus rankNimbostratus
Feb 22, 2018

Adding an exception to an iRule

We have an iRule we are using to remove spaces from URLs, due to some issues we were having. However, I need to adjust the iRule to allow one directory to buy pass the iRule. Here is the iRule:

when HTTP_REQUEST {
    set uri [HTTP::uri]
    set new_uri [string map {"%20" ""} $uri]
    HTTP::uri $new_uri
}

I need it to apply the rule, unless the url starts with ";

How would I add that exception?

2 Replies

  • Something like this:

    when HTTP_REQUEST {
        if { !([string tolower [HTTP::uri]] starts_with "/files") } {
            set uri [HTTP::uri]
            set new_uri [string map {"%20" ""} $uri]
            HTTP::uri $new_uri
        }
    }