Forum Discussion

Julian_Grunnell's avatar
Julian_Grunnell
Icon for Nimbostratus rankNimbostratus
Jan 09, 2007

Specific HTTP to HTTPS redirect

Hi - can someone please help with an iRule I need to do the following please. I have a single HTTP pool and 2 VIPS, one for HTTP and one for HTTPS traffic. The HTTPS VIP does clientssl / SSL termination so only clear text traffic is passed to the pool. I would like an iRule that always redirects a request for http://domain/contactus.aspx to goto https://domain/contactus.aspx. All other parts of the site are just port 80.

 

 

I've tried some of the HTTP to HTTPS iRules but they don't really seem to fit the bill here.

 

 

Thanks in advance - Julian.

 

1 Reply

  • Hello,

    If you want to have the BIG-IP send a 302 redirect when a client makes a request to http://domain/contactus.aspx to https, you can use a rule like this on the HTTP virtual server:

    
    when HTTP_REQUEST {
       if { [HTTP::uri] == "/contactus.aspx" }{
          HTTP::redirect "https://[HTTP::host]/contactus.aspx"
       }
    }

    [HTTP::host] will be resolved to the host header value in the client's request. All other requests not made to /contactus.aspx will be unaffected.

    Aaron