I'm currently putting together a mobile version of an existing site (Django-based) and there seems to be two ways of doing this. I can do one of two things:
Detect a mobile useragent and redirect the user from
http://www.example.com/page/awesome/tohttp://m.example.com/page/awesome/, which serves up mobile-specific markup, CSS etc.Just detect the useragent and serve up different content on the
wwwsubdomain depending on whether the useragent is mobile or not.
To me, (2) feels cleaner, because the site's adapting content served based on the client, but without changing the URL. However, (1) seems to be a lot more prevalent on various popular internet sites, and there must be some good reasoning behind it.
Obviously, (1)'s easier to test, but redirection just feels messy, as well as doubling the number of URLs.
What's the "right" way to do this, and what other pros/cons should I be looking at?