Forum Discussion

Mike_Pones_6391's avatar
Mike_Pones_6391
Icon for Nimbostratus rankNimbostratus
Jul 21, 2005

HTTPS Redirect

I think I have this correct but I just wanted to make sure.

 

 

I have a requirement that when a request comes in on port 80 (http) with "ecommerce" in the URL it should be redirected to the same URL but on port 443 (https). Does this look right:

 

 

if (http_uri contains "ecommerce") {

 

redirect to "https://%h:443/%u/"

 

}

 

else {

 

use pool http_pool

 

}

 

 

Thanks is advance,

 

 

Mike
  • Martin_Machacek's avatar
    Martin_Machacek
    Historic F5 Account
    Mike,

     

     

    your rule is correct. You can actually omit the port specification (:443) in the redirect URL because port 443 is the default for HTTPS transport. So, the redirect string may look like this: "https://%h/%u/"
  • Thanks mmac, I did not think I needed the :443 but was not sure. The example in the book showed it.

     

     

    Thanks again.

     

     

    Mike