# DEDECMS 移动和PC站同步方案

### 后台

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

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

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

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

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

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

~~~

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

location ^~ /uploads/img {

return 404;

}

location ^~ /uploads/thumb {

return 404;

}

~~~

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

~~~

server {

listen 443 ssl http2;

server_name uploads.example;

access_log off;

index index.html index.htm index.php;

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

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

...

}

~~~

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

~~~

# 前端CSS

server {

listen 443 ssl http2;

server_name css.example;

access_log off;

index index.html index.htm index.php;

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

...

}

# 前端JS

server {

listen 443 ssl http2;

server_name js.example;

access_log off;

index index.html index.htm index.php;

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

...

}

# 前端图片

server {

listen 443 ssl http2;

server_name img.example;

access_log off;

index index.html index.htm index.php;

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

...

}

~~~

更多推荐

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