Forum Discussion
Mobile browsers broken - https redirect
Most likely your issue is the "TCP::local_port". Check out the docs for an example with all the values:
https://devcentral.f5.com/wiki/iRules.TCP__local_port.ashx
You'll likely want to use [TCP::Local_port clientside] if you are looking for the front end VIPs port. Omitting the "clientside" is the same as using "serverside".
This potentially should work (haven't tested it thought)
when HTTP_REQUEST {
if {([string tolower [HTTP::host]] starts_with "www.")} {
HTTP::redirect "https://[string range [HTTP::host] 4 end][HTTP::uri]"
return
} elseif { [TCP::local_port clientside] == 80 } {
HTTP::redirect https://[HTTP::host][HTTP::uri]
return
}
}
Beyond that, I'd recommend adding in some log statements and making sure the values you are expecting to match on are working as you expect.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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