I’ve managed to develop some code in php which would use a mobile template instead of the default one, however I’m not sure if I should redirect to a mobile URL (such as /mobile/) or if it’s ok to just have the mobile template showing up instead of the default.
Any thoughts on this?
This is up to you.
Some sites put there mobile view on its own domain, e.g.,
m.yourdomain.comoryourdomain.mobi, and if a mobile user arrives at your non-mobile site (and are detected via agent-string) they’ll be redirected to the mobile domain.However, Tim Berner-Lee states:
There’s something to that. This seems to prefer a non-redirection approach but, instead, detecting the agent type and displaying the appropriate view.
Which approach is better is up for debate.
You could combine the approaches by having your main site respond with views based on agent type while also placing content in a mobile-specific domain (not duplicating it, just mapping the additional domain to it), which will allow phones that don’t send a mobile user agent string to view the lighter mobile site.