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

 5724去下载

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

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

伪静态插件特点:

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

2、支持PC和手机版

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

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

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


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


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

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

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

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

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

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

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

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

8、伪静态成功开启


伪静态开启前后对比:


伪静态开启前伪静态开启后
首页www.xxx.comwww.xxx.com
栏目页www.xxx.com/xinwen/www.xxx.com/xinwen/
内容页www.xxx.com/xinwen/2019/0324/1234.htmlwww.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;
    }
}


本文网址:https://www.zztuku.com/detail-9310.html
转载请声明来自:站长图库 - 织梦伪静态插件、一键开启伪静态


使用声明:

1、本站所有素材,仅限学习交流,请勿用于商业用途。

2、本站资源大多无解压密码,如遇需要解压密码,无特殊说明,均为:zztuku.com

3、下载积分可通过日常 签到绑定邮箱 等途径免费获得!

4、本站提供的源码、模板、软件工具等其他资源,均不包含技术服务,请大家谅解!由于资源大多存储在云盘,如出现链接失效请评论反馈。

5、如果素材损害你的权益,请 联系我们 给予处理。

评论(0)条

您还没有登录,请 登录 后发表评论!

提示:请勿发布广告垃圾评论,否则封号处理!!

    猜你喜欢