Forum Discussion

javier_diaz_379's avatar
javier_diaz_379
Icon for Nimbostratus rankNimbostratus
Mar 08, 2011

Problem with iRule

when HTTP_REQUEST { if {[string match {*[A-Z]*} [HTTP::path]]}{ if{[HTTP::query] equals ""}{ HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]]" } else{ HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]]?[HTTP::query]" } } } When I tried to define this rule, I have this eror: 01070151:3: Rule [dentalfind_URLtolower_RULE] error: line 3: [parse error: extra characters after close-quote] [}{ HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]]" } else{ HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]]?[HTTP::query]" } ] line 5: [unmatched closing character] [}] line 8: [unmatched closing character] [}]

1 Reply

  • Hi Javier,

    Can you try this version? There were some spaces missing.

    
    when HTTP_REQUEST {
       if {[string match {*[A-Z]*} [HTTP::path]]}{
          if {[HTTP::query] equals ""}{
             HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]]"
          } else { 
             HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]]?[HTTP::query]"
          }
       }
    }
    

    Aaron