Forum Discussion

Chris_Olson's avatar
Icon for Nimbostratus rankNimbostratus
Aug 24, 2011

How do I exclude single site from https redirect?

I want all http requests to be redirected to https except one.



For example, the main website tied to the VIP address is I Do NOT want that to be rediected to https.


However, all my other sites


must be redirected to https.


I assume the generic redirect will work along with an if statement to exclude the main site. However, my syntax on the if statement is clearly a mess. I'm sure there is an easier way. Please advise...




HTTP::redirect "]"




if {[HTTP::path] equals ""} HTTP::redirect


2 Replies

  • Hi Chris,

    Here is an example where you can redirect based on the PATH

    when HTTP_REQUEST {
        if {[HTTP::host] eq "" } {
          switch -glob [string tolower [HTTP::uri]] {
            "/uat*" -
            "/stage*" -
            "/prod*" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }

    I hope this helps