Forum Discussion

bwilliam's avatar
bwilliam
Icon for Cirrus rankCirrus
Jun 14, 2017

irule help

I am trying to create the below rule. When I apply it I get the below error. Any help will be appreciated.

error: [parse error: PARSE syntax 55 {syntax error in expression "[HTTP::host]] equals "website.qa.domain.com" and [str...": extra tokens at end of expression}][{[HTTP::host]] equals "website.qa.domain.com" and [string tolower [HTTP::uri]] contains "/mobile/"}]

The irule looks like this:

when HTTP_REQUEST
       {
            if {[HTTP::host]] equals "loanviewbeta.qa.berkadia.com" and {[string tolower [HTTP::uri]] contains "/mobile/"}
       {
            HTTP::redirect "https://[HTTP::host]"
       }
       }

1 Reply

  • Initial look: there's an extra ']' at the end of your first HTTP::host entries. Also an extra '{' in front of 'string tolower'.

    when HTTP_REQUEST {
        if {[HTTP::host] equals "loanviewbeta.qa.berkadia.com" and [string tolower [HTTP::uri]] contains "/mobile/"} {
            HTTP::redirect "https://[HTTP::host]"
        }
    }