网站首页 博客 Nginx的Yii伪静态配置
打开nginx的配置文件,修改以下内容
location / {
root /path/to/webroot;
index index.html index.php;
try_files $uri $uri/ /index.php?r=$request_uri;
if (!-e $request_filename){
rewrite (.*) /index.php last;
}
}
然后重启nginx,就可以使用pathinfo方式的链接地址了,例如
http://127.0.0.1/pathto/controller/action.html