织梦伪静态插件、一键开启伪静态
加入年费会员可免费下载 关注度:
源码编码:UTF-8版本 源码编号:T18
源码结构:自适应 发布时间:2020-09-07
网址演示:网址演示 图片演示 推荐等级:★★★☆☆

织梦伪静态插件发布的一款一键开启伪静态插件,通过该插件可以非常方便的打开织梦伪静态功能,且访问路径与PC版静态地址一致,对SEO更加友好。

页面内容实时更新,无需手动生成html,更加节省时间,彻底解决织梦生成静态页面速度慢,特别是对于文章数量多的网站,每次生成静态HTML会非常痛苦,但不生成静态,默认的动态地址对SEO又不友好,那么开启伪静态就是最好的办法了,开启伪静态后,栏目及文章地址依旧与静态化时的地址一致,但却不用生成html,极大的节省了时间。

织梦伪静态插件、一键开启伪静态

1112

伪静态插件特点:

1、伪静态地址与真实静态地址URL一致

2、支持PC和手机版

3、支持首页、栏目页、内容页、搜索页、TAG标签页的伪静态

4、SEO优化与纯静态页面无异

5、省去繁琐的配置伪静态,只需安装此插件,一键实现整站伪静态。

 

★伪静态插件安装说及配置说明★

1、登录织梦后台,找到左侧菜单‘模块’- ‘上传新模块’

2、点击选择文件上传gbk.xml或者utf8.xml,点击确定完成插件的上传

3、点击左侧菜单‘模块’- ‘模块管理’,点击插件名称右边的‘安装’

4、安装界面可以查看目录是否具有写入权限,需要写入权限才能保证插件的正确安装

5、‘对于已存在文件处理方法’,请选择‘覆盖’,点击确定即可完成插件的安装

6、安装好插件后,在‘模块’ - ‘辅助插件’ - ‘伪静态助手’处填写并保存配置信息

7、点击“详情参见”按钮复制伪静态代码到指定位置

8、伪静态成功开启

伪静态开启前后对比:

  伪静态开启前 伪静态开启后
首页 www.xxx.com www.xxx.com
栏目页 www.xxx.com/xinwen/ www.xxx.com/xinwen/
内容页 www.xxx.com/xinwen/2019/0324/1234.html www.xxx.com/xinwen/2019/0324/1234.html
搜索页 www.xxx.com/plus/search.php?q=关键词 www.xxx.com/search/关键词.html
TAG标签页 www.xxx.com/tags.php?/TAG/ www.xxx.com/tags/TAG.html

www.xxx.com/tags/TAG_ID.html

按照以上步骤配置完后,需要将静态规则部署到相应的服务器或者虚拟主机中:

一、如果您的主机是apache环境

请将以下伪静态代码拷贝至根目录下的.htaccess文件中:

#dedecms电脑端目录结构apache伪静态

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_URI} /+[^\.]+$

RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

#首页

RewriteRule ^/$ /plus/rewrite_index\.php [L]

RewriteRule ^index\.html$ /plus/rewrite_index\.php [L]

RewriteRule ^index\.php$ /plus/rewrite_index\.php [L]

#首页

RewriteRule ^dede/$  /dede/index.php

#TAG标签

RewriteRule ^tags\.html$ /plus/rewrite_tags\.php

RewriteRule ^tags/(.*)\.html /plus/rewrite_tags\.php\?\/$1 [L]

RewriteRule ^tags/(.*)_([0-9])(?:(\?.*))\.html* /plus/rewrite_tags.php?\/$1\/$2; [L]

#搜索页

RewriteRule ^search/(.*)/([0-9]+)\.html$  /plus/rewrite_search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title [L]

RewriteRule ^search/(.*)\.html$  /plus/rewrite_search.php?q=$1&pagesize=10&searchtype=title [L]

#列表栏目

RewriteRule ^(.*)/$ /plus/rewrite_list.php?tid=$1 [L]

#列表栏目分页

RewriteRule ^(.*)/list_([0-9]+)_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2 [L]

RewriteRule ^(.*)/list_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2 [L]

#文章页

RewriteRule ^(.*)/(.*)\.html$ /plus/rewrite_view.php?aid=$1

#文章页分页

RewriteRule ^(.*)/([0-9]+)_([0-9]+)\.html$ /plus/rewrite_view.php?aid=$1&pageno=$2

 

如果需要手机端伪静态,请将以下伪静态代码拷贝至/m目录下的.htaccess文件中:

#dedecms手机目录结构apache伪静态

RewriteEngine On

RewriteBase /m

RewriteCond %{REQUEST_URI} /+[^\.]+$

RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

#首页

RewriteRule ^$ /plus/rewrite_index\.php?mobile=1 [L]

RewriteRule ^index\.html$ /plus/rewrite_index\.php?mobile=1 [L]

RewriteRule ^index\.php$ /plus/rewrite_index\.php?mobile=1 [L]

#TAG标签

RewriteRule ^tags\.html$ /plus/rewrite_tags\.php?mobile=1 [L]

RewriteRule ^tags/(.*)\.html /plus/rewrite_tags\.php\?\/$1&mobile=1 [L]

RewriteRule ^tags/(.*)_([0-9])(?:(\?.*))\.html* /plus/rewrite_tags.php?\/$1\/$2&mobile=1 [L]

#搜索页

RewriteRule ^search/(.*)/([0-9]+)\.html$  /plus/rewrite_search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title&mobile=1 [L]

RewriteRule ^search/(.*)\.html$  /plus/rewrite_search.php?q=$1&pagesize=10&searchtype=title&mobile=1 [L]

#列表栏目

RewriteRule ^(.*)/$ /plus/rewrite_list.php?tid=$1&mobile=1 [L]

#列表栏目分页

RewriteRule ^(.*)/list_([0-9]+)_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2&mobile=1 [L]

RewriteRule ^(.*)/list_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2&mobile=1 [L]

#文章页

RewriteRule ^(.*)/(.*)\.html$ /plus/rewrite_view.php?aid=$1&mobile=1

#文章页分页

RewriteRule ^(.*)/([0-9]+)_([0-9]+)\.html$ /plus/rewrite_view.php?aid=$1&pageno=$2&mobile=1

 

二、如果您的主机是nginx环境

把大括号{}里的代码放到你的nginx配置文件location /{}里面去。如你的环境是使用宝塔面板搭建的,请直接将下面文本框里面的代码粘贴到站点设置中的“伪静态”选项卡中。

location / {

#手机版伪静态规则

#首页

rewrite ^/m/$ /plus/rewrite_index.php?mobile=1 last;

rewrite ^/m/index\.html$ /plus/rewrite_index.php?mobile=1 last;

rewrite ^/m/index\.php$ /plus/rewrite_index.php?mobile=1 last;

#TAG标签

rewrite ^/m/tags\.html$ /plus/rewrite_tags.php?mobile=1 last;

rewrite ^/m/tags/(.*)\.html /plus/rewrite_tags.php?/$1&mobile=1 last;

rewrite ^/m/tags/(.*)_([0-9])(?:(\?.*))\.html* /plus/rewrite_tags.php?/$1/$2&mobile=1 last;

#搜索页

rewrite ^/m/search/(.*)/([0-9]+)\.html$  /plus/rewrite_search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title&mobile=1 last;

rewrite ^/m/search/(.*)\.html$  /plus/rewrite_search.php?q=$1&pagesize=10&searchtype=title&mobile=1 last;

#列表栏目

rewrite ^/m/(.*)/$ /plus/rewrite_list.php?tid=$1&mobile=1 last;

#列表栏目分页

rewrite ^/m/(.*)/list_([0-9]+)_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2&mobile=1 last;

rewrite ^/m/(.*)/list_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2&mobile=1 last;

#文章页

rewrite ^/m/(.*)/(.*)\.html$ /plus/rewrite_view.php?aid=$1&mobile=1 last;

#文章页分页

rewrite ^/m/(.*)/([0-9]+)_([0-9]+)\.html$ /plus/rewrite_view.php?aid=$1&pageno=$2&mobile=1 last;

#PC版伪静态规则

#首页

rewrite ^/$ /plus/rewrite_index.php last;

rewrite ^/index\.html$ /plus/rewrite_index.php last;

rewrite ^/index\.php$ /plus/rewrite_index.php last;

#后台首页

rewrite ^/dede/$  /dede/index.php last;

#TAG标签

rewrite ^/tags\.html$ /rewrite_tags.php;

rewrite ^/tags/(.*)\.html$ /rewrite_tags.php?/$1 last;

rewrite ^/tags/(.*)_([0-9])(?:(\?.*))\.html* /rewrite_tags.php?/$1/$2 last;

#搜索页

rewrite ^/search/(.*)/([0-9]+)\.html$  /plus/rewrite_search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title last;

rewrite ^/search/(.*)\.html$  /plus/rewrite_search.php?q=$1&pagesize=10&searchtype=title last;

#列表栏目

rewrite ^(.*)/$ /plus/rewrite_list.php?tid=$1 last;

#列表栏目分页

rewrite ^(.*)/list_([0-9]+)_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2 last;

rewrite ^(.*)/list_([0-9]+)\.html$ /plus/rewrite_list.php?tid=$1&PageNo=$2 last;

#文章页

rewrite ^(.*)/(.*)\.html$ /plus/rewrite_view.php?aid=$1;

#文章页分页

rewrite ^(.*)/([0-9]+)_([0-9]+)\.html$ /plus/rewrite_view.php?aid=$1&pageno=$2;

if ($request_uri  !~*  \.html$) { 

rewrite ^(.*[^/])$ $1/ permanent;

}

}

 

TAG标签:伪静态(1)

相关模板

最新织梦自适应博客网站源码

宽屏大气的物流搬家家政公司织梦网站模板

响应式机械制造机械租用工程公司织梦模板

图片相册类织梦自适应网站模板

新能源汽车充电桩产品展示网站织梦模板(带手机

添加微信
添加微信,免费咨询

15205695834

新手指南支付购买售后服务关于我们版权合规
合肥秀站网络科技有限公司
Copyright 2002-2022 麦站 版权所有
皖ICP备12018676号 网站地图