Forum Discussion
ShawnO_111386
Dec 30, 2011Nimbostratus
SSL 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]" } } } }
- nitassEmployeeis 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_69413NimbostratusTry this:
when HTTP_REQUEST { if {!([HTTP::uri] eq "/cpt/cptworkflowservice/") } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- nitassEmployeein 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_111386NimbostratusThanks guys... Works like a champ!
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