帝国CMS伪静态教程:栏目及参数设置、规则…

2019-06-0708:14:38网站建设与开发Comments4,258 views字数 1306阅读模式

动态页面不利于收录和排名。伪静态可以完美的解决这问题,配合百度云加速CDN,可以让动态页面有静态页面一样快的访问速度。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

今天开拓族给大家带来帝国CMS伪静态的详细设置方法。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

1)栏目设置为动态访问

改单个栏目属性,如下图文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

帝国CMS伪静态教程:栏目及参数设置、规则…文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

批量修改栏目属性,如下图:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

帝国CMS伪静态教程:栏目及参数设置、规则…文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

2)首页也设置为动态访问

帝国CMS伪静态教程:栏目及参数设置、规则…文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

现在全站都是动态访问了。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

3)伪静态参数设置

帝国CMS伪静态教程:栏目及参数设置、规则…文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

如上图,设置好伪静态参数。如果不会设置,点击默认按钮,使用帝国默认的伪静态规则。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

4)更新信息页地址

帝国CMS伪静态教程:栏目及参数设置、规则…文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

设置好后,网站的超链接都变成伪静态了,但打开网页却显示404。这是因为网站服务器还未配置伪静态规则。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

5)给网站服务器设置伪静态规则

Nginx伪静态规则:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

  1. rewrite ^([^.]*)/listinfo-([0-9]+)-([0-9]+).html$ $1/e/action/ListInfo/$2&page=$3 last;
  2. rewrite ^([^.]*)/showinfo-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/e/action/$2&id=$3&page=$4 last;
  3. rewrite ^([^.]*)/infotype-([0-9]+)-([0-9]+).html$ $1/e/action/InfoType/$2&page=$3 last;
  4. rewrite ^([^.]*)/tags-(.+?)-([0-9]+).html$ $1/e/tags/$2&page=$3 last;
  5. if (!-e $request_filename) {
  6. return 404;
  7. }

修改完配置文件,需要重启nginx生效。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

Apache伪静态规则文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

  1. RewriteEngine On
  2. ErrorDocument 404 /404.html
  3. Rewritebase /
  4. #信息列表
  5. RewriteCond %{QUERY_STRING} ^(.*)$
  6. RewriteRule ^listinfo-(.+?)-(.+?).html$ /e/action/ListInfo/$1&page=$2
  7. #信息内容页
  8. RewriteCond %{QUERY_STRING} ^(.*)$
  9. RewriteRule ^showinfo-(.+?)-(.+?)-(.+?).html$ /e/action/$1&id=$2&page=$3
  10. #标题分类列表页
  11. RewriteCond %{QUERY_STRING} ^(.*)$
  12. RewriteRule ^infotype-(.+?)-(.+?).html$ /e/action/InfoType/$1&page=$2
  13. #TAGS信息列表页
  14. RewriteCond %{QUERY_STRING} ^(.*)$
  15. RewriteRule ^tags-(.+?)-(.+?).html$ /e/tags/$1&page=$2
  16. #评论列表页
  17. RewriteCond %{QUERY_STRING} ^(.*)$
  18. RewriteRule ^comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html$  /e/pl/$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6

至此,帝国CMS伪静态教程圆满结束。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/13506.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/cms/13506.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定