第一步:开启手机网站。位置:模块 》手机门户 》 添加手机站点,具体设置可参照截图:
第二步:创建栏目分类,位置:模块 》手机门户 》 分类管理,具体设置可参照截图:
第三步:域名管理中心,解析二级域名m.lanrenmb.com到PC网站所在的IP,同时在主机控制面板,添加绑定m.lanrenmb.com这个域名。先修改配置文件caches/configs/route.php,在'default'=>array('m'=>'content', 'c'=>'index', 'a'=>'init'),后面添加一行,
return array(
'default'=>array('m'=>'content', 'c'=>'index', 'a'=>'init'),
'm.cmsyou.com'=>array('m'=>'wap', 'c'=>'index', 'a'=>'init','data'=>array('GET'=>array('siteid'=>1))),
);
|
第四步:然后再修改为:并且在手机模板(index.html或者header.html)里边加入一段js:
<script>
try {if( self.location == "http://m.lanrenmb.com/" ) {
top.location.href = "http://m.lanrenmb.com/index.php";
}
}
catch(e) {}
</script>
|
域名解析生效后,通过m.lanrenmb.com就能访问到手机网站了,那如何修改手机网站模板界面样式呢?可以在Phpcms V9 程序系统位置:/phpcms/templates/default/wap/