当前位置:Gxlcms > PHP教程 > nginxrewriterule解决思路

nginxrewriterule解决思路

时间:2021-07-01 10:21:17 帮助过:17人阅读

nginx rewrite rule
实现下面的rewrite:
abc.domian.com/sort/2 => abc.domian.com/index.php?act=sort&name=abc&id=2

nginx.conf里面这么写是正确的吧:
rewrite ^/(.+)\/(\d+)\/?$ /index.php?act=$1&id=$2 last;

------解决思路----------------------
基本可以确定你用的CI框架




if (\$request_uri !~ ^/(html
------解决思路----------------------
static
------解决思路----------------------
favicon/.ico
------解决思路----------------------
robots/.txt
------解决思路----------------------
index/.php.*) ) {
rewrite ^/(.*)\$ /index.php/\$1 last;
break;
}

人气教程排行