Forum Discussion

Jeff_Durr_42068's avatar
Jeff_Durr_42068
Icon for Nimbostratus rankNimbostratus
Nov 03, 2006

Redirecting based on url extension

I would appreciate some more I-rule experienced eyes looking at this redirect. I'm getting the following in the error logs.

 

 

TCL error: Rule xmro_redirect_http - invalid command name "" while executing "[HTTP::redirect https://xmro-secure.fred.com] "

 

 

I assume it's a syntax error, but I just don't know where I hosed it up.

 

 

My I-rule is as follows:

 

 

when HTTP_REQUEST {

 

if {[HTTP::uri] ends_with "/echannel"}{

 

[HTTP::redirect https://ecare.fred.com/echannel]

 

}

 

else { [HTTP::redirect https://xmro-secure.fred.com] }

 

}

 

 

Thanks

 

Jeff

1 Reply

  • You don't need brackets around the commands in this context.

    when HTTP_REQUEST {
      if {[HTTP::uri] ends_with "/echannel"}{
        HTTP::redirect "https://ecare.fred.com/echannel"
      } else { 
        HTTP::redirect "https://xmro-secure.fred.com"
      }
    }

    -Joe