Forum Discussion

Todd_VanDerwerk's avatar
Todd_VanDerwerk
Icon for Nimbostratus rankNimbostratus
Oct 05, 2006

HTTPS Redirect

I have this iRule in place

 

 

when HTTP_REQUEST {

 

HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]

 

}

 

 

 

and I am getting this error

 

 

TCL error: Rule redirect_to_https - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]"

 

 

 

Any ideas?

 

 

  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    That error usually occurs when another iRule applied to the same virtual before this iRule has already issued a redirect.

     

     

    You'll need to change the existing redirect code in the iRule(s) applied BEFORE this one to prevent subsequent rules from being processed for this request, and to prevent subsequent requests on Keep-Alive connections. To do so, use HTTP::respond instead of HTTP::redirect so you can add a Close header, and since the following rule only has the event HTTP_REQUEST, disable that event:
    HTTP::respond 302 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri] Connection Close
    event HTTP_REQUEST disable

     

     

    HTH

     

    /deb
  • Thank you for the response, but this is the only iRule applied to this virtual server, but I do have the same iRule applied to a different virtual server without issue
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    If you have the same rule applied to a different virtual without any problems, then it sounds like the issue isn't with the iRule at all. What's different about this VIP's configuration?

     

     

    Colin