Forum Discussion

Kirit_Patel_521's avatar
Kirit_Patel_521
Icon for Nimbostratus rankNimbostratus
Mar 26, 2010

http to https redirect

I am trying to do the following how can that be achieved using irules

 

 

 

http(S)://renprod.ctb.com will go to http://renprod.ctb.com/ctb.com/control/main

 

 

http(S)://renprod.ctb.com/admin go to https://renprod.ctb.com/admin/control/main

 

 

Thanks

 

 

 

1 Reply

  • Do you want to redirect http and https / to https://renprod.ctb.com/ctb.com/control/main and /admin to https://renprod.ctb.com/admin/control/main?

    If so you could create separate HTTP and HTTPS virtual servers. Add a client SSL profile to the HTTPS VIP and then add an iRule like this to both VIPs:

     
     when HTTP_REQUEST { 
      
         Check the requested path 
        switch [HTTP::path] { 
           "/" { 
              HTTP::redirect "http://renprod.ctb.com/ctb.com/control/main" 
           } 
           "/admin" { 
              HTTP::redirect "https://renprod.ctb.com/admin/control/main" 
           } 
           default { 
               Take some default action? 
           } 
        } 
     } 
     

    Aaron