当前位置: 代码迷 >> PHP >> nginx rewrite rule解决思路
  详细解决方案

nginx rewrite rule解决思路

热度:11   发布时间:2016-04-28 18:16:51.0
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;
                }
  相关解决方案