|
为了方便,做站静态的每次更新都很麻烦,这是要就需要一个伪静态插件了,这款伪静态插件简单明了,(首页、栏目、内容、TAG、搜索页)全都伪静态处理
咨询本站客服QQ:1406244 获得(10元一份) (只有utf-8版本)
伪静态插件特点:
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 |
如何鉴别一个网站是伪静态还是真静态
方法一、查看列表页的文章点击次数,如果实时更新,则说明是伪静态,否则为真静态
方法二、使用谷歌Chrome浏览器查看
先用Chrome浏览器打开该网址 ,等网页完全打开后进入浏览器的控制台,方法:“开发者工具“-“错误控制台”,快捷键:shift+ctrl+J ,然后在控制台里面输入:alert(document.lastModified); ,按回车键后查看最后修改时间并记录。
如果弹出的窗口显示的时间为当前时间,则说明是伪静态,否则为真静态。
按照以上步骤配置完后,需要将静态规则部署到相应的服务器或者虚拟主机中:
一、如果您的主机是apache环境
请将以下伪静态代码拷贝至根目录下的.htaccess文件中: - #dedecms电脑端目录结构apache伪静态RewriteEngine OnRewriteBase /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\.phpRewriteRule ^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 OnRewriteBase /mRewriteCond %{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;}}
复制代码
伪静态插件3.0最新版的伪静态规则下载:
(责任编辑:网络) |
|