标签:
找到nginx配置文件中的location ~ \.php$
去掉后面的"$"
在中括弧里的最下面添加:
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
加号的代码如下面:
location ~ \.php {
#原来的代码
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
重启nginx就可以了
(亲测)nginx解决thinkphp中pathinfo的问题
标签:
原文地址:http://www.cnblogs.com/liangyeyue/p/4381189.html