Forum Discussion
Joe_Pipitone
Nimbostratus
Oct 05, 2015Bypass SSL redirect if URI is....
I have 2 set of iRules that I'd like to combine into 1, however I'm unable to apply the logic without the result ending up in a loop.
The end result needs to be - if the URI is "/articles/2015/09/0...
Joe_Pipitone
Nimbostratus
Oct 06, 2015This may work:
when HTTP_REQUEST {
set is_ssl [PROFILE::exists clientssl]
set is_ssl_URL [string compare -nocase [HTTP::uri] "/articles/2015/09/09/something.aspx"]
if { $is_ssl && !($is_ssl_URL)} {
HTTP::redirect http://[getfield [HTTP::host] ":" 1][HTTP::uri]
} elseif { !($is_ssl) && $is_ssl_URL} {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
} elseif {([string tolower [HTTP::host]] starts_with "www.")} {
HTTP::redirect "https://[string range [HTTP::host] 4 end][HTTP::uri]"
}
}
- Joe_PipitoneOct 06, 2015
Nimbostratus
Perhaps in the future we can incorporate different logic to support multiple URLs in case the request comes in to exclude more from HTTPS. Thank you all again for the help and effort.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
