How does a website detect whether http requests are comming from a mobile device or not? In my mind, it's all just TCP/IP packets with a standard address/port header right? Is this a hardware/routing thing? Is it the hosting service like Apache? What does one need to know to prepare a website for mobile redirection?
2 Answers
Generally speaking, this is most likely done by inspecting the HTTP-User-Agent that is sent in the HTTP request. http://en.wikipedia.org/wiki/User_agent has more information. Mobile safari sends a different string that the web page can investigate (via js/php/etc), and then serve different content, or change the stylesheet, or send them to a different page. Also, server data compression can be quite useful in general, but especially for mobile devices, especially because many mobile broadband connections are quite slow. So the server will also use optimization techniques for data, again especially helpful for mobile clients.
-
Bingo. A ready-made script for doing this is available at detectmobilebrowsers.com– ceejayozDec 15, 2011 at 21:05
-