Nginx hiding index.php

You are viewing revision #3 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 or see the changes made in this revision.

« previous (#2)next (#4) »

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请看这里

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

Revisions

View all history

Related Articles