Forum Discussion
dlogsdonmd
Nimbostratus
Dec 22, 2014301 Permanent HTTPS redirect
Hello,
I just updated an iRule for my HTTPS object as shown below, it now forwards https://cardiosmart.org to https://www.cardiosmart.org. What I need now is to modify further to incorporate a ...
Brad_Parker
Cirrus
Dec 22, 2014I would use and elseif and put the one that gets hit the most as the first if. That will make the rule more efficient.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "healthandwellness.cardiosmart.org" } {
HTTP::respond "HTTP/1.1 301 Moved Permanently\r\nLocation:https://www.cardiosmart.org[HTTP::uri]\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
}
elseif { [string tolower [HTTP::host]] equals "cardiosmart.org" } {
HTTP::respond "HTTP/1.1 301 Moved Permanently\r\nLocation:https://www.cardiosmart.org[HTTP::uri]\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
}
}
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
