|
发表于 2017-5-12 18:51:54
|
显示全部楼层
我一般是改 nginx 的配置来实现 URI 分段和 GET 传参都支持的。CI 中国的服务器就是这样配的。如果你是 nginx 的话,可以参考下。
- location / {
- try_files $uri $uri/ /index.php$uri?$args;
- }
- location ~ ^(.+\.php)(.*)$ {
- fastcgi_pass xxxx;
- fastcgi_index index.php;
- include fastcgi.conf;
- 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;
- }
复制代码
|
|