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

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

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

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

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

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

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

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

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

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

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

8、伪静态成功开启

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

一、如果您的主机是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;

}

}

下载权限

查看
  • 免费下载
    评论并刷新后下载
    登录后下载

  • {{attr.name}}:
您当前的等级为
登录后免费下载登录 小黑屋反思中,不准下载! 支付以后下载 请先登录登录 评论后刷新页面下载评论 支付积分以后下载立即支付 支付以后下载立即支付 您当前的用户组不允许下载升级会员
您有每天免费下载所有资源次的特权,今日剩余 已取得下载权限

人已赞赏
软件程序

Xshell6.0.0193免费版下载

2020-4-26 19:17:43

软件程序

ping值测试软件(GoPing) v1.0.1.18 免费版

2021-2-1 9:51:53

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索