Forum Discussion
Chris_Miller
Aug 02, 2010Altostratus
Damien,
The first thing you need to do is implement the logic for your rule to detect whether the user is an iPhone. For this, you'll use the HTTP::header command to query the "User-Agent" header.
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__header.html
You'll do an iRule like this and put it on your www.mysite.com VIP
when HTTP_REQUEST {
if { [HTTP::header "User-Agent"] contains "iPhone"] } {
HTTP::redirect "http://m.mysite.com" }
}
When you want to do more than just iPhones, you'll want to create a "datagroup" which contains all types of phones and reference that instead of just the string "iPhone"
Shall I assume the VIP to which m.mysite.com points has a pool of web servers setup to render mobile-specific content?