Difference between #1 and #2 of How to hide index.php on nginx

unchanged
Title
Nginx hiding index.php
unchanged
Category
Tutorials
unchanged
Tags
changed
Content
nginx+fastcgi+php方式下隐藏index.php需要注意几个问题

一个是配置PATH_INFO,不然无法使用yii urlManager的path格式
记得加上"fastcgi_param PATH_INFO $fastcgi_script_name;
"这行
~~~
[php]
location ~ \.php {      
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    access_log off;
}
~~~

还有一个是rewrite规则
~~~
[php]
location /yiiGuestbook {
    if (!-e $request_filename){
        rewrite (.*) /yiiGuestbook/index.php/$1;
    }
}
~~~

[ApacheApache hiding
index.php请看](http://www.yiiframework.com/doc/guide/topics.url)index.php请看:(http://www.yiiframework.com/doc/guide/topics.url)