botyboat钓鱼艇网站绑定方法实录新建 文本文档.txt
1首先dnspod解析m站域名到服务器,指向m域名到IP即可,电脑上访问m域名站仍然是pc站点
2在服务器上绑定m域名,至此 双向绑定完毕。
3在移动模版底部加上百度提供的移动端强制跳转代码即可实现
baidu百度竞价提供的 移动端强制跳转代码
<script type="text/javascript">
function browserRedirect() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
window.location.href = 'm/index.php';
} else {
}
}
browserRedirect();
</script>
-------------
4然后去站长平台提交正则匹配规则
http://m.botyboat.com/m/product/lehejinting6/33.html
http://www.botyboat.com/product/lehejinting6/33.html
http://m.botyboat.com/m/product/lehejinting6/32.html
http://www.botyboat.com/product/lehejinting6/32.html
http://m.botyboat.com/m/product/lehejinting6/31.html
http://www.botyboat.com/product/lehejinting6/31.html
正则匹配 站长平台提交
http://m.botyboat.com/m/product/lehejinting6/${1}.html
http://www.botyboat.com/product/lehejinting6/(\d+).html
已提交
PC URL 移动URL 适配类型 提交时间 处理状态 操作
http://www.botyboat.com/p... http://m.botyboat.com/m/p... 规则适配 2016-09-26 11:32:18 校验中
--------------------------
5原理是
移动手机搜索,进入m.botyboat.com后PC端仍然指向的是PC页面
但是如果检测到是移动端访问防战,那么由于PC页面的footer.tpl模版加入了强制跳转代码,
那么所有的移动端访问都会跳转到移动页面http://m.botyboat.com/m/index.php
================
其实这是另类的思路
还有另外2个方法
(一)把m站视为独立站点,独立买个服务器,放m站代码,代码可以用百度移动站生成或者
这种方法感觉不是很好,还是百度竞价提供的跳转代码好!