User agents for mobile site, domain changing

北城以北 提交于 2020-01-11 11:19:10

问题


I have a mobile site and I'd like to redirect users to the domain.mobi or mobile.subdomain (we have both setup)

  1. How do I determine a mobile browser
  2. Is it bad practice to have the mobile site on a different domain or subdomain?

回答1:


  1. How do I determine a mobile browser

Here's some javascript that will do the job: http://www.quirksmode.org/js/detect.html

  1. Is it bad practice to have the mobile site on a different domain or subdomain?

It's good practice, and a popular convention is to use http://m.yoursite.com for mobile if your main url is http://yoursite.com

Noah




回答2:


It isn't bad practice. I appreciate when sites do this -- and I like it if they include a link for me to get to the real site if I want.

I found this list in google -- there are other hits if you search for them

http://www.zytrax.com/tech/web/mobile_ids.html




回答3:


There are a number of solutions for determining mobile browsers. Most use the UserAgent making the request but some solutions use other factors as well.

Try looking at:

WURFL

MDBF

DeviceAtlas

DetectRight

Volantis

MobileAware

Movila

UAProf



来源:https://stackoverflow.com/questions/1034222/user-agents-for-mobile-site-domain-changing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!