关于百度蜘蛛抓取的问题百度蜘蛛能判断js吗
百度站长吧
全部回复
仅看楼主
level 11
网站名:同乐宝 地址:http://www.tonglebao.com 为了节约空间实现pc和移动端的相应跳转,所以把移动端做成了二级目录,咋个老火了,百度抓取诊断,不跳转了只能抓取跳转页面了,怎么办啊?
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <script type="text/javascript"> function ShowIndex(){ 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="mobile/mobile_index.action"; }else{ location.href="index.action"; }} window.onload=ShowIndex; </script> </head> <body onload="ShowIndex()"> </body></html>
2015年08月17日 02点08分 1
level 11
高手解答啊,我不晓得咋个回事啊,有没有办法js对蜘蛛友好啊
2015年08月17日 02点08分 2
1