How to run mobile version of a website?

2019-06-24 11:04发布

问题:

There are two common ways to run mobile version of a website:

  1. Detecting the mobile browser by server-side scripting to display mobile theme.

  2. Having a separate subdomain such as m.domain.com or mobile.domain.com.

Which is better in action? In both cases, I think mobile search engines fairly index the mobile website. What are pros and cons for each method?

回答1:

Option 1: This is more user-friendly for a few reasons. The biggest is probably link sharing and bookmark syncing. If a user on a desktop browser gets shared a link to a m.domain.com, it won't look very good, and non-savvy users will get annoyed. There are also certain users that prefer all pages to be in desktop mode (even on their mobile browser,) so all they need to do is adjust their user agent string on their mobile browser.

Option 2: Some people find this easier, but I can't think of a good reason for it with modern web development. ASP.NET MVC4 makes it really easy to create separate views for the same URL and there's simple functionality to switch between mobile and desktop mode. I would stay away from the subdomain option unless you find a very good reason to use it.



回答2:

I'm not a big fan of displaying mobile theme/css since it'd be completely different than the regular css.

Also I think search engines will like that your site has more content since the mobile site will be considered as "more content"

Since they're seperate it'll be easier to deal with one or the other.

Negative is it's more work. Even though it's less complicated.

These are my 2 cents.



回答3:

I think responsive design is a simplest solution without any need of sub-domain or extra effort to put on how it looks on many different kinds of devices!

Responsive design is do-and-forget-it kind of design. once it is done properly and tested well, not matter what kind of device you are using to browse, it always makes look and feel better way. No need of separate development for multiple views.



回答4:

I feel media query is the way to go for small websites. http://webdesignerwall.com/tutorials/responsive-design-with-css3-media-queries