Forum Discussion
OCC_68606
Nimbostratus
Jun 14, 2011iRule 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" } { ...
Ashish_Ram_Tak1
Nimbostratus
Mar 07, 2013Dear Nitass,
Thanks so much for your help, if i want to use mre mobile types will below iRule works
when HTTP_REQUEST {
if { [HTTP::host] equals "home.example.co.in" } {
if { [URI::query "?&[HTTP::query]" main] equals "true" } {
return
}
if { [string tolower [HTTP::header "User-Agent"]] contains "iphone" -
"android" -
"ipad" -
"blackberry" -
"windowsphone" -
"windows phone" -
"windowsce" -
"windows ce" -
"symbainos" -
"symbain os" -
"symbain" -
"java" } {
HTTP::redirect "https://lite.example.co.in"
}
} elseif { [URI::query "?&[HTTP::query]" main] equals "true" } {
HTTP::redirect "https://home.example.co.in?main=true"
}
}
Waiting for your reply.
Regards,
Ashish Takawale.
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