Forum Discussion
azakaria_102538
Nimbostratus
Dec 28, 2013Smartphone 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
nitass
Employee
Dec 28, 2013e.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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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