- 模板介绍
- 常见问题
- 阿里云1G虚拟主机,低至99元/首年
为了节省时间,咨询客服请带上本页链接+问题。
使用快捷键Ctrl+D收藏本站,下次访问更方便哟!
2023免费建站:免费企业建站及优化排名,有效果在付费,详情咨询在线客服!
模板编码 : UTF-8版本 | 模板编号 : T18 | 模板源件 : 完全开源 | 程序内核 : DEDECMS5.7 |
发布时间 : 2020-09-07 22:29:05 | 模板类型 : 织梦模板 | 模板大小 : 20 MB | 推荐等级 : ★★★☆☆ |
织梦伪静态插件发布的一款一键开启伪静态插件,通过该插件可以非常方便的打开织梦伪静态功能,且访问路径与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.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; } } |
入门视频教程 | 1、PHPstudy本地搭建PHP环境视频教程 |
2、会员模板之整站源码安装视频教程 | |
3、织梦程序备份视频教程 | |
4、织梦入门视频教程 | |
5、织梦系统采集视频教程 | |
织梦技术QQ群 | |
织梦安全教程 | >>织梦最新安全设置、>>织梦备份教程; |
评论列表(条)