控制器访问404问题
本地调试正常,访问正常。windows的传到服务器(nginx的),访问首页地址(也就是默认的welcome)可以显示。但是如果输入http://ip/index.php/welcome就 报404,所以,我的控制器都报404. 是不是nginx的设置有问题,ci这边设置能否修改。感谢 已更换apache 唉 NGINX 默认不支持path_info 模式请百度谷歌 一下让NGINX 支持path_info 模式:lol ;P还是apache吧 nginx就没有办法了吗? server
{
listen 80;
server_namelocalhost;
index index.php index.htm index.html;
root/www/php_example/;
#limit_conn crawler20;
location / {
index index.php index.html;
#rewrite ^([^.]+)$/index.php?c=$1 last; 短网址规则
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location ~ .*\.(php|php5)?$
{
#fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_pass127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ .*\.(php|php5)?($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
}
}
页:
[1]