pathinfo配置问题~

浏览:532 发布日期:2015/08/26 分类:求助交流
一开始配置的nginx不支持pathinfo,后来网上找方法配置好了之后发现访问
http://xxxx/index.php/Index
是好的,但是在index后面加上/
http://xxxx/index.php/Index/
这样就会报非法操作:index.php,Index里面是写了index方法的。
下面是网上找的pathinfo的配置:        set $path_info "";
        set $real_script_name $fastcgi_script_name;
        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                set $real_script_name $1;
                set $path_info $2;
        }
        fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
        fastcgi_param SCRIPT_NAME $real_script_name;
        fastcgi_param PATH_INFO $path_info;

最佳答案
评论( 相关
后面还有条评论,点击查看>>