Nginx hiding index.php

You are viewing revision #1 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.

next (#2) »

nginx+fastcgi+php方式下隐藏index.php需要注意几个问题

一个是配置PATH_INFO,不然无法使用yii urlManager的path格式 记得加上"fastcgi_param PATH_INFO $fastcgi_script_name; "这行

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规则

location /yiiGuestbook {
    if (!-e $request_filename){
        rewrite (.*) /yiiGuestbook/index.php/$1;
    }
}

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

4 0
12 followers
Viewed: 91 425 times
Version: Unknown (update)
Category: Tutorials
Tags: URL
Written by: miles
Last updated by: Darwin Wen
Created on: Feb 20, 2009
Last updated: 12 years ago
Update Article

Revisions

View all history

Related Articles