azakaria_102538
Dec 28, 2013Nimbostratus
Smartphone detection
Hi: kindly i need an IRULE that when a smartphone need to access URL www.mysite.com\AAA to redirect it to another link www.mysite.com\BBB
thanks for help
e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.20.15:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 29
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/aaa" } {
if { [class match -- [string tolower [HTTP::header "User-Agent"]] contains mobile_useragent] } {
HTTP::respond 302 noserver Location "http://[HTTP::host]/BBB" Connection Close
}
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm data-group internal mobile_useragent
ltm data-group internal mobile_useragent {
records {
iphone { }
}
type string
}
test
[root@ve11a:Active:In Sync] config curl -I http://172.28.20.15/AAA -H "User-Agent: Apple-iPhone5C1/1001.405"
HTTP/1.0 302 Found
Location: http://172.28.20.15/BBB
Connection: close
Content-Length: 0