Linux主机宝或纯环境开启PATHINFO的方法
ReLinux主机宝或纯环境开启PATHINFO的方法
我改了过后必须是/index.php/c/m才能访问,而/c/m不行,前面必须加个index.php
配置文件是这样的,哪里有问题呢
erver{
listen 80;
server_name 123.57.150.24;
root /a/domains/123.57.150.24/public_html;
index index.html index.htm index.shtml index.php;
error_page 404 /404.html;
#Custom rules Start
#Custom rules End
location = /500.html {
root /usr/share/nginx/html;
}
location ~ \.php(/.*)?$ {
fastcgi_pass unix:/dev/shm/php.sock;
include fastcgi_params;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
access_log /a/apps/nginx/logs/123.57.150.24.access.log main;
set $real_script_name $fastcgi_script_name;
set $path_info '';
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;
}
location /
{
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;
break;
}
}
赞0
踩0