移动重定向 [英] Mobile Redirect

查看:51
本文介绍了移动重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,最近我被要求为其创建移动版本,现在我已经完成了该操作,我被要求进行自动重定向,以便用户是否通过PDA/iPhone/智能手机/他/她会自动定向到m.website.com,但我不知道该怎么做=/我已经尝试过使用google找到的一些php和javascript,但到目前为止没有任何帮助.你们可以吗?

I have a webpage and I was recently asked to create the mobile version for it, now that I've done it I was asked to make an automatic redirection so that if the user goes into the webpage through a PDA/iPhone/Smartphone/etc he/she gets automatically directed to the m.website.com but I have no idea how to do this =/ I've tried some php's and javascripts I found using google but nothing so far has helped me. Could you guys?

推荐答案

签出WURFL并为其匹配其移动浏览器用户代理字符串列表的User-Agent构建302重定向器.

Check out WURFL and build a 302 redirector for User-Agents that match its list of mobile browser user-agent strings.

或者,只需在User-Agent中查找iPhone,然后将其重定向到您的iPhone站点即可.其他浏览器占有如此小的市场份额,因此几乎不值得针对它们. iPhone是移动Web HTML流量的67%.您可以在网页上的Javascript中完成此操作.

Or, just look for iPhone in the User-Agent and redirect those to your iPhone site. The other browsers command such small market-share it is hardly worth targeting them. iPhone is 67 percent of the mobile web HTML traffic. You could do this in Javascript on your web page.

这篇关于移动重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆