nginx thnkphp rewrite 规则

我的nginx版本是1.0.××

我的每一个网站都有一个××××.conf 文件,打开这个文件

找到

location / {×××××}

将其修改成 

location / {
root /var/www;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}

然后重新启动nginx

posted @ 2016-01-04 16:42  dcj890828  阅读(123)  评论(0编辑  收藏  举报