rdessert_76127
Jul 19, 2012Nimbostratus
Help with adding mobile redirect to existing irule
Hi all,
I have been asked to redirect a handful of mobile device types (user agents) to our mobile homepage and am having some trouble getting the irule configured properly.
My current homepage irule is as follows:
when HTTP_REQUEST {
if { [HTTP::host] equals "site.com" } {
HTTP::respond 301 Location "http://www.site.com[HTTP::uri]"
return
} else {
log local0.alert "BEGIN Host:[HTTP::host]-[HTTP::uri]-[HTTP::path]"
switch -glob [string tolower [HTTP::uri]] {
"/" -
"/*" -
"/\\?*" -
"/foo/*" -
"/news/*" -
"/sites/*" -
"/node/*"
{
log local0.alert "op_pool Host:[HTTP::host]-[HTTP::uri]"
pool op_pool
return
}
default {
pool def_pool
}
}
}
}
I need to redirect the following user agents to http://m.site.com
blackberry
wp7
iphone
androi
Any suggestions on how / where to add the mobile redirect. I'm thinking it needs to go at the beginning but don't know the best syntax.
Thanks for any help!!
Rich