Forum Discussion
Chris_D_15752
Nimbostratus
May 02, 2011Mobile redirect with forced SSL
Hi guys,
I am faced with dual puzzle for site demending dual function redirect causing some issses.
I need to provide detection process from www.main.com site provide mobile type v...
Luke_Drury_7634
Nimbostratus
May 14, 2012Hi Guys
I am in the same boat, and have been trying to do the cookie detection with no success.
My scenario is as follows:
I have two virtual servers
blah.com and mobile.blah.com
I can deploy the below irule on the blah.com vs and get only the agents I want to be redirected to the mobile site.
On the mobile virtual server I am using persistence to drop a cookie called blah-mobilesite.
On the mobile site developers have just put a link back to the main blah.com site.
Kinda hard to trigger off.
So i am figuring that if a client has been to the mobile site and picked up the blah-mobilesite cookie and then gone to the main site it is because they have been sent their by the link.
Here is the rule I am working with atm.
when HTTP_REQUEST {
Check if the full site cookie preference has already been set
if {[HTTP::cookie value "blah-mobilesite"] eq "*"}{
Exit this event in this iRule to avoid a possible redirect to the mobile site
return
}
... rest of the iRule logic to check for mobile user-agents
and redirect them to the mobile site
switch -glob [string tolower [HTTP::header User-Agent]] {
"*blackberry*" -
"*firefox*" -
"*iphone*" -
"*android*" {
HTTP::redirect "http://mobile.blah.com/"
return
}
}
}
I have checked and the client does receive the blah-mobilesite cookie when they visit the mobile site.
I just can't seem to make the irule detect that they have it.
Any suggestions would be greatly appreciated, I think I am clearly missing something here.
btw I have just included firefox to make testing easier.
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