RFLORY_78743
Oct 17, 2012Nimbostratus
Redirecting one HTTPS url to another HTTPS url
I am trying to redirect our mobile users to our new mobile site with a simple iRule. The rule works fine for http traffic as it flows through but for HTTPS it does not work. No errors, it just seems to not redirect even though the debug messages are showing that it goes through the motions. I read another post where it states without a proxy that you cannot do it, but I am not sure I follow. I see multiple posts where others have apprently been able to get it to work
when HTTP_REQUEST {
log 10.40.25.59:34555 local0. "Entered iRule"
if { [string tolower [HTTP::host]] starts_with "www"}{
if { [string length [HTTP::uri]] < 2 } {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*android*" -
"*blackberry*" -
"*iphone*" -
"*ipod*" -
"*googlebot-mobile*" {
log 10.40.25.59:34555 local0. "[IP::client_addr]: Redirect Path - [HTTP::host][HTTP::path] - User Agent [HTTP::header User-Agent]"
HTTP::respond 301 Location "https://m.mydomain.com/content/mobile/en/home.html"
return
}
}
}
}
}