1. 程式人生 > >yii2 nginx去掉index.php?r=

yii2 nginx去掉index.php?r=

nginx目錄下的nginx.config的location節點新增如下配置 
location / {
  if (!-e $request_filename) {
      rewrite  ^(.*)$  /index.php?s=/$1  last;
  }
} 

 

nginx目錄下的nginx.config的location節點新增如下配置

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