tags:

views:

116

answers:

3

Hi, if i wanted to create a mobile friendly version of a relatively small website would it be better to have a sub domain that redirects to a completely new url with sperate markup and styling or would it be better to detect the useragent in code and programatically change to a different mobile friendly stylesheet, or is their a better infrastructure based solution i am overlooking..

Thanks.

+1  A: 

You could try abit of both. Have the main site detect the useragent, then redirect to the completly new domain. That way its more automated but your main site code wont have tons of if statements depending on if its a mobile or not as the new domain would take care of that.

If you go with this tho, always add a link on the mobile site so that users can view the main site if they please... use cookies tho else youll end up getting redirected to the mobile site.

Ozzy
A: 

If SEO isn't really a concern, Using different stylesheets with the same HTML is much easier, in terms of maintenance.

Tim Hettler
@Tim Hettler: could you plz explain more on how to do it?
Marco Demajo
You can use the media attribute of the link element to target specific devices. For example: <link rel="stylesheet" href="example.css" media="handheld"> will only target 'handheld' (mobile devices). You can use 'all' if you want a stylesheet to be applied to all device types. All the different media types are listed here: http://www.w3.org/TR/CSS2/media.html
Tim Hettler
A: 

Both can good in terms subdomain/subsite. . subdomain is a bit confusion .i recomend u for subsite

Take a glimpse of mobile friendly websites

http://techlaugh.com/top-10/10-reasons-mobile-friendly-website/

Anupam Tamrakar