Forum Discussion

2 Replies

  • Hi Dave,



    I suggest configuring a separate virtual server for HTTP and one for HTTPS. If you add a client SSL profile, you can redirect client requests to hosts using the same iRule as shown below. Or if you wanted to use separate iRules for HTTP and HTTPS, you could simplify the iRules and remove the CLIENT_ACCEPTED event and hard code the protocol to http:// or https://.



        Check  the client's destination port
       switch [TCP::local_port] {
          443 {
              Request is to an SSL port
             set proto "https"
          default {
              Request is to a non-SSL port
             set proto "http"
    when HTTP_REQUEST {
        Check if host isn't
       if {[string tolower [HTTP::host]] ne ""}{
           Redirect to the same protocol and URI to the correct hostname
          HTTP::redirect "${proto}://[HTTP::uri]"



  • Thanks. I'll give that a try. I would never have come up with this solution.