Forum Discussion

Frederic_Zelle2's avatar
Frederic_Zelle2
Icon for Nimbostratus rankNimbostratus
Mar 17, 2006

http to https redirect

Hi all

 

 

One of our customer has a problem with a simple iRule ( his first 9.x iRule )

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] ends_with "mysite.com/"} {

 

HTTP::redirect "https://www.trans.mysite.com/TransitNetWeb/"

 

}

 

}

 

 

 

To me everything looks fine but I am unfortunately unable to test it on a BIGIP right now

 

 

Does anything look wrong ?

 

 

I'm wondering about some blank space issue

 

 

Any help appreciated

 

 

TIA

 

 

Fred

2 Replies

  • Most likely you are looking for the host, not the uri. Also, if this rule is applied against a wildcard virtual and you are offloading ssl, you'll end up in a redirection loop. It should be fine if the virtual is specific to http, or you are not offloading ssl.

    
    when HTTP_REQUEST {
      if { [HTTP::host] ends_with "mysite.com"} {
      HTTP::redirect "https://www.trans.mysite.com/TransitNetWeb/"
      } 
    }