Mobile browsers broken - https redirect
BigIP 1600's - v11.6 HF 4
I have a simple iRule that forces https and strips the www. We have a CMS running that automatically detects the user agent, and redirects the mobile browser to the mobile version of the website. As soon as I applied the following iRule, mobile browsers appeared to be broken upon the first initial page load request.
With mobile Safari on iOS, (as well as Android) I get the following message when I browse the site:
"Safari cannot open the page because it could not load any data"
If I refresh the page a 2nd time, the mobile version of the website loads.
What would be the best way to troubleshoot this? Would I need to implement logging to capture the user agent, and where the client is trying to go? Why would a refresh cause the page to load on the 2nd attempt?
Here's the iRule:
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] == 80 } {
HTTP::redirect https://[HTTP::host][HTTP::uri]
return
}
}