Forum Discussion
dolly_pandit
Jun 02, 2020Nimbostratus
IRULE FOR HTTP to HTTPS REDIRECTION FOR ALL TRAFFIC EXPECT SOME URI
HI Everyone, I am looking for an irule where i need to redirect all the traffic from http to https expect for some URI's. example: URI's: /abc , /bbc, /xyz anything starting with URI's traffi...
- Jun 02, 2020
Hello,
What about use "switch" ?
https://www.tcl.tk/man/tcl8.7/TclCmd/switch.htm
e.g.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "/abc*" - "/bbc*" - "/xyz*" { # do nothing } default { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } }
Regards
cjunior
Jun 02, 2020Nacreous
Hello,
What about use "switch" ?
https://www.tcl.tk/man/tcl8.7/TclCmd/switch.htm
e.g.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/abc*" -
"/bbc*" -
"/xyz*" {
# do nothing
}
default {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
}
Regards
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