Recently studied the CI framework, found that the framework of the routing function under Nginx problems, reported 404 errors, and later on-line search information,
Discover the need to turn on path_info. After nginx7.16 seems to support the path_info, just need to open in the configuration file.
Open the Nginx.conf file and add the rewrite rules under your virtual host code as follows:
Copy CodeThe code is as follows:
server {
Listen 80;
server_name www.ci.com;
Location/{
Root D:/WWW/CODEIGNITER_2.0.1/;
Index index.html index.htm index.php;
Rewrite ^/$/index.php last;
rewrite^/(?! Index\.php|robots\.txt|images|js|styles) (. *) $/index.php/$1last;
}
Location ~^ (. +\.php) (. *) $ {
Root D:/WWW/CODEIGNITER_2.0.1/;
Fastcgi_index index.php;
Fastcgi_split_path_info ^ (. +\.php) (. *) $;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Fastcgi_param path_info $fastcgi _path_info;
Fastcgi_param path_translated $document _root$fastcgi_path_info;
Fastcgi_pass 127.0.0.1:9002;
Include Fastcgi_params;
}
}
http://www.bkjia.com/PHPjc/327188.html www.bkjia.com true http://www.bkjia.com/PHPjc/327188.html techarticle recently studied the CI framework, found that the framework of the routing function under Nginx problems, reported 404 errors, and later on-line search data, found the need to open path_info. After nginx7.16 seems to support ...