Forum Discussion

skkg_111590's avatar
Icon for Nimbostratus rankNimbostratus
Nov 18, 2010

SSL (https) redirection to http.




Can you please advise me how to redirect https to http.



Below rule is not working



when HTTP_REQUEST { if { [HTTP::uri] eq } {


HTTP::redirect "http://[HTTP::host][HTTP::uri]"






Any help will be appreciated.




4 Replies




    HTTP::host is


    HTTP::uri is /



    http or https will be determined by virtual server's service port i.e. :80 or :443.



    hope this helps.
  • As Nitass suggests, you could use the HTTPS to HTTP redirect on an HTTPS VS by checking for a Host of and a URI of /:

    when HTTP_REQUEST {
       if { [HTTP::host] eq "" and [HTTP::uri] eq "/" } {
          HTTP::redirect "http://[HTTP::host][HTTP::uri]"

    Out of curiosity, why do you want to redirect just to HTTP?

  • Thanks alot NITASS AND HOOLIO



    Your irule is working like a charm .


    I just want to replace test with not secure.



    Thanks alot for the help.



    God bless you.
  • Just a couple of questions for my own clarification... if I read the iRule written by hoolio correctly, wont this only redirect root level HTTPS requests (eg.

    Given the and statement, wouldn't the redirect fail if the trailing slash in the URI was omitted? (eg.

    Also, if a request for a nested resource was made, wouldn't that also fail to redirect? (eg.

    Would removing the conditional and solve this problem?

    when HTTP_REQUEST {
       if { [HTTP::host] eq "" } {
          HTTP::redirect "http://[HTTP::host][HTTP::uri]"

    I'm still getting my head around iRules, so these are just questions (not trying to tell anyone how to do things)

    Cheers üôÇ