
我想把我的移动站点切换到主站点。请记住,当你在手机上打开facebook,然后在移动版本中facebook的视图是改变的,当你点击“转到主站点”时,它在移动中出现主站点。这是我想要的。
而且主要的问题是这两个链接是相同的方式
main site url is http://www.yousite.com
mobile site url is http://www.yousite.com当你在移动端打开时,移动模板被显示,当我打开桌面时,主站点模板被显示。
发布于 2013-04-16 04:29:34
我已经在我的网站的前一个版本上这样做了,并在这里写道:http://arleym.com/mobile-device-detection-redirection/
基本上,我有一些设备检测将被忽略,如果有一个查询字符串。因此,"view desktop version“链接将避免检测/重定向,并为用户提供cookie。
我使用了这个检测脚本:http://detectmobilebrowsers.mobi/
并像这样修改了我的开关:
<?php
if(isset($_GET['switch'])){
setcookie('switch',$_GET['switch']); // set a cookie
}
if(!isset($_GET['switch']) && !isset($_COOKIE['switch'])){
require_once('/server/path/arleym.com/mobile_device_detect.php'); //Andy Moore's script
mobile_device_detect(true,false,true,true,true,true,true,'
http://arley.me',false);
}
?>查看器桌面url只是像href="http://whatever.com?switch=0“那样做它的事情
https://stackoverflow.com/questions/15471075
复制相似问题