Nginx环境下supesite discuz wordpress rewrite 规则

//supesite nginx 静态化规则

rewrite ^/([0-9]+)/spacelist(.+)$ /index.php?uid/$1/action/spacelist/type$2 last;

rewrite ^/([0-9]+)/viewspace(.+)$ /index.php?uid/$1/action/viewspace/itemid$2 last;

rewrite ^/([0-9]+)/viewbbs(.+)$ /index.php?uid/$1/action/viewbbs/tid$2 last;

rewrite ^/([0-9]+)/(.*)$ /index.php?uid/$1/$2 last;

rewrite ^/([0-9]+)$ /index.php?uid/$1 last;

rewrite ^/action(.+)$ /index.php?action$1 last;

rewrite ^/category(.+)$ /index.php?action/category/catid$1 last;

rewrite ^/viewnews(.+)$ /index.php?action/viewnews/itemid$1 last;

rewrite ^/viewthread(.+)$ /index.php?action/viewthread/tid$1 last;

rewrite ^/mygroup(.+)$ /index.php?action/mygroup/gid$1 last;

//discuz nginx 静态化规则

rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;
break;

//wordpress nginx 静态化规则
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}

版权所有:《太阳花工作室》 => 《Nginx环境下supesite discuz wordpress rewrite 规则
本文地址:http://bg.artuion.com/linux/188.html
除非注明,文章均为 《太阳花工作室》 原创,欢迎转载!转载请注明本文地址,谢谢。