帝国CMS访问PC端跳转到手机端动态页和静态页怎么实现?

页面头部

JS代码在body前面加上以下HTML源代码

<script type="text/javascript">
try {var urlhash = window.location.hash;if (!urlhash.match("fromapp"))
{if ((navigator.userAgent.match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i)))
{window.location="https://m.xxx.com/";}}}
catch(err)
{
}</script>
<meta name="mobile-agent" content="format=xhtml;url=https://m.xxx.com/">

列表页

动态页:https://m.xxx.com/e/action/ListInfo/?classid=[!--self.classid--]
静态页:https://m.xxx.com<?$r['classid']=$GLOBALS[navclassid];$classurl=sys_ReturnBqClassname($r,9);echo $classurl;?>

内容页

动态页:https://m.xxx.com/e/action/ListInfo/?classid=[!--self.classid--]
静态页:https://m.xxx.com<?$r['classid']=$GLOBALS[navclassid];$classurl=sys_ReturnBqClassname($r,9);echo $classurl;?>

分成动态与静态页面,可自行选择更换为自己的子域名。

本文摘自网络,不代表短经典网立场 https://www.duanjingdian.com/1134.html

上一篇 1天前
下一篇 1天前

相关推荐