Forum Discussion

Roger_Grannum_7's avatar
Roger_Grannum_7
Icon for Nimbostratus rankNimbostratus
Oct 06, 2009

HTTPS Redirect

Searching the forum for a sample IRule but could not find anything. Hoping I might get some direction from the forum. I'm looking for an IRule that will re-direct https request. I understand I will have to load the certificate on the F5 (no problem) but unsure if I just can use a IRule or would also need to utilize SSL Client Profile.

 

We are doing a site re-design with a new URL but not taking down the old (fall back)one, so we want the F5 to handle the re-directs.

 

Example: User types in https://www.oldsite.com/orders and I want them re-directed to https://orders.newsite.com/page1.
  • If the LTM is carrying the cert and being applied by the SSL cleint profile then the F5 iRule should work since it's being decrypted.

    NOTE: This is assuming the backend connection between the LTM and pool member is http

    Here is an example of what the irule would look like

     
     when HTTP_REQUEST { 
         if {[HTTP::host] eq "www.oldside.com" and [HTTP::uri] eq "/orders" } { HTTP::redirect "https://orders.newsite.com/page1" } 
     } 
     

    I hope this helps

    CB

  • Thanks a million for the response -- Life Saver...

     

    This is the project from hell -- I just got new requirements. The one or two URI's has become 60. So what I need is the use script above for one URI and then a "ELSE" "OR" to send everyone who does a https://www.oldsite.com/URI to go https://www.differentsite.com/ and past the URI -- "ELSE" "OR" https://www.oldsite.com (with no URI) to go to http://www.newsite.com

     

     

    Is this possible???

     

     

    Roger