m端如果不能自動跳轉(zhuǎn)時,還是顯示的是PC端模板,可考慮查看 PC端的模板里是否有以下代碼,如果添加以下代碼,即可
<meta http-equiv="mobile-agent" content="format=xhtml;url=/mobile/index.php">
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href="/m/index.php";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>---------------------
比較 啰嗦的說明:
在以上代碼中,原
url=/mobile/index.php
在原有的 目錄結(jié)構時,很多用戶的 不是在mobile目錄下,而是在/m 目錄下,因此會訪問出錯,或者不能跳轉(zhuǎn)到手機端的模板上。
原代碼可能是:
url=/m/index.php
這時需要修改成:
url=/mobile/index.php
即可。(前提是,你的是 m站,綁定的是mobile)