Forum Discussion
Chris_Olson
Aug 24, 2011Nimbostratus
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 www.website.com. I Do NOT want that to be rediected to https.
However, all my other sites www.website.com/uat
www.website.com/stage
www.website.com/prod
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...
when HTTP_REQUEST {
HTTP::redirect "]"
}
if {[HTTP::path] equals "www.website.com"} HTTP::redirect
- The_BhattmanNimbostratusHi Chris,
when HTTP_REQUEST { if {[HTTP::host] eq "www.website.com" } { switch -glob [string tolower [HTTP::uri]] { "/uat*" - "/stage*" - "/prod*" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } }
- Chris_OlsonNimbostratusThank you very much. This will help greatly!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects