zoukankan      html  css  js  c++  java
  • 帝国cms的tags页面url伪静态的设置

    帝国cms的tags页面url默认是 /e/tags/index.php?tagname=XXX

    这种形式的,我们希望的是后缀变成

    http://www.lingganzuowen.com/tags-etagid17-0.html(其中后面的0是页数,前面的id就是tags的id)

    其中这种形式的

    那么如何来设置呢?

    如图所示:

    说明:采用静态页面时不需要设置,只有当采用动态页面时可通过设置伪静态来提高SEO优化,如果不启用请留空。注意:伪静态会增加服务器负担,修改伪静态格式后你需要修改服务器的 Rewrite 规则设置。

    .htaccess文件内容:(这里我测试机上用的是apche,如果别的环境请自行转换)

    <ifmodule mod_rewrite.c>
    RewriteEngine On
    ErrorDocument 404 /404.html
    Rewritebase /
    #信息列表
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^listinfo-(.+?)-(.+?).html$ /e/action/ListInfo/index.php?classid=$1&page=$2
    #信息内容页
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^showinfo-(.+?)-(.+?)-(.+?).html$ /e/action/ShowInfo.php?classid=$1&id=$2&page=$3
    #标题分类列表页
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^infotype-(.+?)-(.+?).html$ /e/action/InfoType/index.php?ttid=$1&page=$2
    #TAGS信息列表页
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^tags-(.+?)-(.+?).html$ /e/tags/index.php?tagname=$1&page=$2
    #评论列表页
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html$  /e/pl/index.php?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6
    </ifmodule>
    

      nginx的规则如下:

    rewrite ^/tags-(.+?)-([0-9]+).html$ /e/tags/index.php?tagname=$1&page=$2 last;
  • 相关阅读:
    烯烃(olefin) 题解
    二分图的考验 题解
    树上的好题
    [SDOI2013]直径 题解
    [ZJOI2010]数字计数 题解
    神在夏至祭降下了神谕 题解
    洛谷 P4198 楼房重建 题解
    [HAOI2010]软件安装 题解
    [POI2011]ROT-Tree Rotations 题解
    可并堆之左偏树浅谈
  • 原文地址:https://www.cnblogs.com/qq9836/p/12866858.html
Copyright © 2011-2022 走看看