Forum Discussion
ShawnO_111386
Nimbostratus
Dec 30, 2011SSL Redirect - with one URI exception
I'm trying to create a ssl redirect that will forward all port 80 requests to 443 but want one URI excluded from doing so. I've created the following but my iRule skills aren't sharp enough to figure out what's missing.
when HTTP_REQUEST { if {[HTTP::uri] eq "/cpt/cptworkflowservice/" } { switch -glob [string tolower [HTTP::uri]] { { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } } }
4 Replies
- nitass
Employee
is this correct?[root@ve1023:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {not([HTTP::uri] equals "/cpt/cptworkflowservice/")} { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } } - Brian_69413
Nimbostratus
Try this:when HTTP_REQUEST { if {!([HTTP::uri] eq "/cpt/cptworkflowservice/") } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } - nitass
Employee
in case of "not equal".[root@ve1023:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[HTTP::uri] ne "/cpt/cptworkflowservice/"} { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } } - ShawnO_111386
Nimbostratus
Thanks guys... Works like a champ!
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
