Forum Discussion
Ahmad_03_151082
Nimbostratus
Mar 24, 2015Http to Https except specific URLs
Dears,
I am facing an issue with iRules i have created below iRule
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":"][HTTP::uri]
...
Hannes_Rapp_162
Nacreous
Mar 25, 2015Good luck 😉
when HTTP_REQUEST {
switch [string tolower [HTTP::host][HTTP::path]] {
"abc.com/xyz" -
"abc.com/example1" -
"abc.com/example2" {
return
do nothing
}
default {
HTTP::respond 302 location "https://[HTTP::host][HTTP::uri]"
event disable
prevent a possibility of multiple redirect invocations (not needed, if it's your only iRule attached to the VS)
TCP::close
remove the TCP connection record from the connections table. Needed for some browsers, because if the connections record remains, the same redirect will not work the second time in a different tab.
}
}
}
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