在网页模板的<head>与</head>之间加入以下代码就可以实现手机访问电脑的静态网页跳转到手机站的相应页面
1:内容页代码
<script type="text/javascript">
if(/Android|webOS|iPhone|iPod|BlackBerry|Windows CE|Windows Phone/i.test(navigator.userAgent)){
if(window.location.href.indexOf("?pc")<0){try{window.location.href="/3g/Show.asp?m={$ChannelID}&d={$InfoID}"}catch(e){}}
}
</script>
2:栏目页代杩
<script type="text/javascript">
if(/Android|webOS|iPhone|iPod|BlackBerry|Windows CE|Windows Phone/i.test(navigator.userAgent)){
if(window.location.href.indexOf("?pc")<0){try{window.location.href="/3g/list.asp?id={$GetSmallClassID}"}catch(e){}}
}
</script>
3:网站首页代码
<script type="text/javascript">
if(/Android|webOS|iPhone|iPod|BlackBerry|Windows CE|Windows Phone/i.test(navigator.userAgent)){
if(window.location.href.indexOf("?pc")<0){try{window.location.href="/"}catch(e){}}
}
</script>