What if the user really wants to access the website rather than the mobilesite?
The solution I'm thinking of is this:
Having a special root page on the domain
http://example.com. Here I detect when a user access the website with a mobile devices, and then redirects to the mobilesite (
http://m.example.com). I also detect non-mobile devices and redirect them to the main website (
http://example.com/frontpage). This way it's possible to access the main website with a mobile device and the mobilesite with a browser.
Is there a better approach to automatic redirect?