Forum Discussion
iRule Redirect Mobile Site
I have this iRule to identify mobile browser, for example apple devices:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "www.mainsite.com" } {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*iphone*" -
"*ipod*" -
"*ipad*" {
HTTP::redirect "http://mobilesite.com[HTTP::uri]"
return
}
}
}
}
mobilesite.com has a link to www.mainsite.com (In case you don´t like be in mobile site)
I want to do something that manage if you are in mobile site and you want to go to main site the iRule does not enter in a loop.
Any ideas??
Jorge.
- hooleylistCirrostratusHi Jorge,
- OCC_68606NimbostratusThanks Hoolio, let me check the information.
Regards.
Jorge
- OCC_68606Nimbostratus
Hi, I need to have the option to redirect to full site in my m.site.com, but a don´t have any idea to do that, I have the main site in a different pool than mobile one. Could anyone give me some information to get documentation to do this configuration?
Escenario.
From a mobile device enter to full.site.com --> user agent detection redirecto to m.site.com --> if I prefer to go to full.site.com I don´t want to enter in a loop.
Regards.
JVM
- nitassEmployeedoesn't the cookie which Aaron suggested in the past discussion topic work?
- OCC_68606NimbostratusHi Have problems to detect cookie from full and mobile site. Do you have any script?
Thanks.
JVM
- OCC_68606Nimbostratus
As a comment I have the main site and the mobile site in different virtual servers, pools, etc. for me are two different applications. How can I manage the iRule, by cookie or by referer??
Regards.
JVM
- nitassEmployeeHave problems to detect cookie from full and mobile site. Do you have any script?sorry i do not have.
- Ashish_Ram_Tak1NimbostratusDear All,
- nitassEmployeeis this helpful?
- Ashish_Ram_Tak1Nimbostratus
Dear Nitass,
The below link is helpfull, but i dont want to redirect por particural uri's just want to redirct if user clik on link then redirect that to main site. If possible could you please help me with iRule.
Regards,
Ashish
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