星联网络专注帝国CMS二次功能插件开发-精品网站模板站长代码素材

  • 最近更新
  • 模板:33
  • 记录:12639|
  • 插件:52|
  • 工具:4|
  • 代码:8|
  • 评论:0

帝国CMS在Nginx下的伪静态规则大全详细写法

前言

本文讲解了帝国CMS在Ngix环境下的URL伪静态插件规则,结合项伪静态规则,指定URL跳转URL伪静态规则,帝国CMS的TAG伪静态规则,404伪静态规则,基本上覆盖帝国CMS的所有伪静态规则的写法。

  本文讲解了帝国CMS在Nginx环境下的URL伪静态插件规则,结合项伪静态规则,指定URL跳转URL伪静态规则,帝国CMS的TAG伪静态规则,404伪静态规则,基本上覆盖帝国CMS的所有伪静态规则的写法。

帝国CMS在Nginx下的伪静态规则大全详细写法

rewrite ^/news/([0-9]+)/0/index.html$ /category/$1/0/  permanent;
以上是指定url伪静态处理,适用于网站更改了URL有规则的变化
rewrite ^/category/([0-9]+)/0/$ /category/$1/ permanent;
rewrite ^/category/([0-9]+)/$ /e/tags/?tagid=$1&page=0;
rewrite ^/category/([0-9]+)/$ /e/tags/?tagid=$1;
rewrite ^/category/([0-9]+)/([0-9]+)/$ /e/tags/?tagid=$1&page=$2;
以上是针对tag伪静态写法
rewrite ^/down-([0-9]+)-([0-9]+)-([0-9]+).html$ /e/DownSys/DownSoft/?classid=$1&id=$2&pathid=$3 last;
以上是针对下载模型或者下载字段进行的伪静态处理
rewrite ^/img/m([0-9]+)/a([0-9]+)/$ /e/extend/newszy/smalltxt.php?end=$1&start=$2 last;
rewrite ^/muban/$ /e/action/list.php?ph=1&classid=1&terminal=0&mblx=0&priarea=0&page=0 last;
rewrite ^/muban/t([0-9]+)m([0-9]+)s([0-9]+)/$ /e/action/ListInfo.php?ph=1&classid=1&terminal=$1&mblx=$2&priarea=$3&page=$4 last;
rewrite ^/yuanma/$ /e/action/list.php?ph=1&classid=2&bianma=0&terminal=0&ymlx=0&page=0 last;
rewrite ^/yuanma/t([0-9]+)m([0-9]+)s([0-9]+)/$ /e/action/ListInfo.php?ph=1&classid=2&bianma=$1&terminal=$2&ymlx=$3&page=$4 last;
rewrite ^/chajian/$ /e/action/list.php?ph=1&classid=3&bianma=0&priarea=0&cjclass=0&page=0 last;
rewrite ^/chajian/t([0-9]+)m([0-9]+)s([0-9]+)/$ /e/action/ListInfo.php?ph=1&classid=3&bianma=$1&priarea=$2&cjclass=$3&page=$4 last;
rewrite ^/sucai/$ /e/action/ListInfo.php?ph=1&classid=7&category=0&priarea=0&bianma=0&page=0 last;
rewrite ^/sucai/t([0-9]+)m([0-9]+)s([0-9]+)/$ /e/action/ListInfo.php?ph=1&classid=7&category=$1&priarea=$2&bianma=$3&page=0 last;
rewrite ^/sucai/t([0-9]+)m([0-9]+)s([0-9]+)/p([0-9]+)/$ /e/action/ListInfo.php?ph=1&classid=7&category=$1&priarea=$2&bianma=$3&page=$4 last;
以上是针对结合项的伪静态写法,这里是指定的某类,也可以把sucai,chajian,yuanma,改成id的形式,那么整个伪静态规则会更加简单一些,我这里主要是方便SEO采用这种写法,
rewrite ^/college/([0-9a-zA-Z]+)/([_0-9]*).html$ /marketing/$1/$2.html  permanent;
rewrite ^/biji/([0-9a-zA-Z]+)/([_0-9]*).html$ /notes/$1/$2.html  permanent;
rewrite ^/ke/course/$ /kec/  permanent;
rewrite ^/kec/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=0&crowd=0&grade=0&price=0&page=0 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s0p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=0&page=$4&price=0 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s1p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=1&page=$4&price=免费 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s2p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=2&page=$4&price=1__200 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s3p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=3&page=$4&price=201__500 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s4p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=4&page=$4&price=501__1000 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s5p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=5&page=$4&price=1001__10000 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s0p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=0&page=$4&price=0&orderby=onclick&dj=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s1p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=1&page=$4&price=免费&orderby=onclick&dj=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s2p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=2&page=$4&price=1__200&orderby=onclick&dj=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s3p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=3&page=$4&price=201__500&orderby=onclick&dj=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s4p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=4&page=$4&price=501__1000&orderby=onclick&dj=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s5p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=5&page=$4&price=1001__10000&orderby=onclick&dj=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s0p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=0&page=$4&price=0&orderby=plnum&pl=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s1p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=1&page=$4&price=免费&orderby=plnum&pl=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s2p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=2&page=$4&price=1__200&orderby=plnum&pl=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s3p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=3&page=$4&price=201__500&orderby=plnum&pl=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s4p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=4&page=$4&price=501__1000&orderby=plnum&pl=1 last;
rewrite ^/kec/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s5p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=112&ph=1&kctype=$1&crowd=$2&grade=$3&pri=5&page=$4&price=1001__10000&orderby=plnum&pl=1 last;
rewrite ^/ke/down/$ /ked/  permanent;
rewrite ^/ked/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=0&crowd=0&grade=0&price=0&page=0 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s0p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=0&page=$4&price=0 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s1p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=1&page=$4&price=免费 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s2p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=2&page=$4&price=1__200 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s3p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=3&page=$4&price=201__500 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s4p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=4&page=$4&price=501__1000 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s5p([0-9a-zA-Z]+)/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=5&page=$4&price=1001__10000 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s0p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=0&page=$4&price=0&orderby=onclick&dj=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s1p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=1&page=$4&price=免费&orderby=onclick&dj=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s2p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=2&page=$4&price=1__200&orderby=onclick&dj=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s3p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=3&page=$4&price=201__500&orderby=onclick&dj=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s4p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=4&page=$4&price=501__1000&orderby=onclick&dj=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s5p([0-9a-zA-Z]+)/check/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=5&page=$4&price=1001__10000&orderby=onclick&dj=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s0p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=0&page=$4&price=0&orderby=plnum&pl=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s1p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=1&page=$4&price=免费&orderby=plnum&pl=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s2p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=2&page=$4&price=1__200&orderby=plnum&pl=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s3p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=3&page=$4&price=201__500&orderby=plnum&pl=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s4p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=4&page=$4&price=501__1000&orderby=plnum&pl=1 last;
rewrite ^/ked/t([0-9a-zA-Z]+)r([0-9a-zA-Z]+)d([0-9a-zA-Z]+)s5p([0-9a-zA-Z]+)/is/$ /e/action/ListInfo.php?classid=113&ph=1&kctype=$1&crowd=$2&grade=$3&pri=5&page=$4&price=1001__10000&orderby=plnum&pl=1 last;
rewrite ^/teacher/$ /e/action/list.php?ph=1&classid=114&jstype=0&city=0&page=0 last;
rewrite ^/teacher/t([0-9]+)r([0-9]+)p([0-9]+)/$ /e/action/ListInfo.php?ph=1&classid=114&jstype=$1&city=$2&page=$3 last;
rewrite ^/teanews/([0-9]+)/$ /e/action/ListInfo.php?ph=1&id=$1&classid=115&tempid=19 last;
rewrite ^/jb/([0-9]+)_([0-9]+).html$ /e/public/report/?classid=$1&id=$2 last;
rewrite ^/search-([0-9]+)-([0-9]+).html /e/search/result/?searchid=$2&page$1 last;

下面是帝国CMS的URL伪静态插件的伪静态规则
if (!-f $request_filename){
    set $rule_0 1$rule_0;
}
if ($request_uri !~ "^(/d/|/ecmsphp/|/muban/totaldown/|/muban/update/|/muban/onclick/|/muban/fabu/|/chajian/totaldown/|/chajian/update/|/chajian/onclick/|/chajian/fabu/|/yuanma/totaldown/|/yuanma/update/|/yuanma/onclick/|/yuanma/fabu/|/category/([0-9]+)/([0-9]+)/|/category/([0-9]+)/|/yuanma/t([0-9]+)m([0-9]+)s([0-9]+)/|/muban/t([0-9]+)m([0-9]+)s([0-9]+)/|/e/|/html/|/images/|/s/|/search/|/skin/|/u/|/t/|/ad/)"){
    set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
    rewrite ^/([0-9a-zA-Z-/]+)/(|index.html|index_[0-9]+.html)$ /e/action/list.php?classid=$1&page=$2 last;
    rewrite ^/([0-9a-zA-Z-/]+)/([0-9a-zA-Z]+)([_0-9]*).html$ /e/action/show.php?classid=$1&id=$2&page=$3 last;
}
if (!-e $request_filename) {
    return 404;
}

  如果有什么疑问可以付费咨询客服

本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。

本文地址:http://www.xlkjgs.com/notes/ecms/s15624.html

以上内容由本站整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

星联网络

星联网络是中国最具实战的互联网创业者的知识服务商,这里有互联网行业动态,网络推广,SEO优化,SEM优化,ESC配置,行业经验分型,互联网项目,微信营销、淘宝客赚钱、新媒体营销、京东运营、跨境电商等众多互联网营销知识分享

站长运营站长必备网站运营之道才能长久发展