Forum Discussion

Luca_55898's avatar
Luca_55898
Icon for Nimbostratus rankNimbostratus
Aug 04, 2011

redirect HTTPS to HTTP

So this is backwards from most requests, but i need to redirect anything that comes to a site on HTTPS to HTTP.

Will this do it?


when HTTP_REQUEST {
     if {[HTTP::uri] equals {https://www.site.com/page1}} {HTTP::uri {http://www.site.com/page1}
       }
}

11 Replies

  • The easiest way would be to create a virtual server and associate an irule. Below is the configuration I did and getting the page redirect it to HTTP.

     

    abc_443 ltm virtual abc_443_443 { destination 101.172.31:https ip-protocol tcp mask 255.255.255.255 profiles { http { } tcp-lan-optimized { context serverside } tcp-wan-optimized { context clientside } abc_client { context clientside } } rules { HTTPS_to_HTTP } source 0.0.0.0/0 translate-address enabled translate-port enabled vs-index 49 }

     

    ltm rule HTTPS_to_HTTP { when HTTP_REQUEST { HTTP::redirect http://[getfield [HTTP::host] ":" 1][HTTP::uri] } }

     

    Note: You can ignore the tcp-lan-optimized and tcp-wan-optimized, that was client request and use simple TCP.