织梦手机端的index.html,织梦PC和手机网站同步方案

# DEDECMS 移动和PC站同步方案

### 后台

1. PC和移动站共用一套数据库,两套CMS系统,操作方法:

> 首先默认安装PC端CMS系统到服务器,然后再复制PC端完整CMS到移动端网站目录

2. 选择PC或者M端进入后台,创建如下全局变量:

> ![](https://box.kancloud.cn/8acb8d38b4bf6b87f1ee1e44f32edb3c_731x160.jpg)

3. 在`static.example.com`目录下按照之前章节的介绍创建对应的目录

4. 在服务器nginx上配置好访问规则:

~~~

# 禁止使用常规URL访问附件

location ^~ /uploads/img {

return 404;

}

location ^~ /uploads/thumb {

return 404;

}

~~~

5. 同时创建一个附件主机

~~~

server {

listen 443 ssl http2;

server_name uploads.example.com;

access_log off;

index index.html index.htm index.php;

# 这里是实际的附件物理路径

root /alidata1/web/www.example.com/uploads;

...

}

~~~

6. 创建前台前端资源主机

~~~

# 前端CSS

server {

listen 443 ssl http2;

server_name css.example.com;

access_log off;

index index.html index.htm index.php;

root /alidata1/web/static.example.com/css;

...

}

# 前端JS

server {

listen 443 ssl http2;

server_name js.example.com;

access_log off;

index index.html index.htm index.php;

root /alidata1/web/static.example.com/js;

...

}

# 前端图片

server {

listen 443 ssl http2;

server_name img.example.com;

access_log off;

index index.html index.htm index.php;

root /alidata1/web/static.example.com/img;

...

}

~~~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值