douyin2435 2010-09-17 21:28
浏览 41
已采纳

php移动重定向

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?

  • 写回答

2条回答 默认 最新

  • doubo1711 2010-09-17 21:55
    关注

    This is up to you.

    Some sites put there mobile view on its own domain, e.g., m.yourdomain.com or yourdomain.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:

    It is fundamentally useful to be able to quote the URI for some information and then look up that URI in an entirely different context. For example, I may want to look up a restaurant on my laptop, bookmark it, and then, when I only have my phone, check the bookmark to have a look at the evening menu. Or, my travel agent may send me a pointer to my itinerary for a business trip. I may view the itinerary from my office on a large screen and want to see the map, or I may view it at the airport from my phone when all I want is the gate number.

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)