YUNUCMS Nginx下伪静态规则

日期:2017-10-18 人气:1072

适用于1.0.9版本

if (!-d $request_filename){

set $rule_0 1$rule_0;

}

if (!-f $request_filename){

set $rule_0 2$rule_0;

}

if ($rule_0 = "21"){

rewrite ^/(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.htm;

}

rewrite ^/admin/(.*).html$ /index.php?s=admin/$1 last;

rewrite ^/admin/(.*)$ /index.php?s=admin/$1 last;

rewrite ^/m/$ /index.php?s=wap/index/index last;

rewrite ^/m/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$3&area=$1&cw=$4 last;

rewrite ^/m/(.*)_(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$3&area=$1 last;

rewrite ^/m/search/$ /index.php?s=wap/search/index last;

rewrite ^/m/myform/$ /index.php?s=wap/myform/index last;

rewrite ^/m/captcha/(.*)$ /index.php?s=wap/myform/captcha&id=$1 last;

rewrite ^/m/(.*)_search/$ /index.php?s=wap/search/index&area=$1 last;

rewrite ^/m/(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$2&cw=$3 last;

rewrite ^/m/(.*)_tag/([\s\S]*)$ /index.php?s=wap/tag/index&title=$2&area=$1 last;

rewrite ^/m/tag/([\s\S]*)$ /index.php?s=wap/tag/index&title=$1 last;

rewrite ^/m/(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$2 last;

rewrite ^/m/(.*)_(.*)/$ /index.php?s=wap/category/index&ctitle=$2&area=$1 last;

rewrite ^/m/(.*)_(.*)/page/(.*)$ /index.php?s=wap/category/index&ctitle=$2&area=$1&page=$3 last;

rewrite ^/m/(.*)/$ /index.php?s=wap/category/index&ctitle=$1 last;

rewrite ^/m/(.*)/page/(.*)$ /index.php?s=wap/category/index&ctitle=$1&page=$2 last;

rewrite ^/m/(.*).html$ /index.php?s=wap/index/index&area=$1 last;

rewrite ^/statics/ueditor/dialogs/(.*)/(.*).html$ /statics/ueditor/dialogs/$1/$2.html last;

rewrite ^/index(.*)/$ /index.php?s=index/index/index/$1 last;

rewrite ^/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$3&area=$1&cw=$4 last;

rewrite ^/(.*)_(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$3&area=$1 last;

rewrite ^/myform/$ /index.php?s=index/myform/index last;

rewrite ^/(.*)_myform/$ /index.php?s=index/myform/index&area=$1 last;

rewrite ^/captcha/(.*)$ /index.php?s=index/myform/captcha&id=$1 last;

rewrite ^/(.*)_captcha/(.*)$ /index.php?s=index/myform/captcha&area=$1&id=$2 last;

rewrite ^/search/$ /index.php?s=index/search/index last;

rewrite ^/search/page/(.*)$ /index.php?s=index/search/index&page=$1 last;

rewrite ^/(.*)_search/$ /index.php?s=index/search/index&area=$1 last;

rewrite ^/(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$2&cw=$3 last;

rewrite ^/(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$2 last;

rewrite ^/(.*)_tag/([\s\S]*)$ /index.php?s=index/tag/index&title=$2&area=$1 last;

rewrite ^/tag/([\s\S]*)$ /index.php?s=index/tag/index&title=$1 last;

rewrite ^/(.*)_(.*)/$ /index.php?s=index/category/index&ctitle=$2&area=$1 last;

rewrite ^/(.*)_(.*)/page/(.*)$ /index.php?s=index/category/index&ctitle=$2&area=$1&page=$3 last;

rewrite ^/(.*)/$ /index.php?s=index/category/index&ctitle=$1 last;

rewrite ^/(.*)/page/(.*)$ /index.php?s=index/category/index&ctitle=$1&page=$2 last;

rewrite ^/(.*).html$ /index.php?s=index/index/index&area=$1 last;