In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how the CodeIgniter framework rewrites rules under Nginx. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.
Recently, I studied CI framework and found that the routing function of this framework has problems under Nginx, reporting 404 errors. Later, I checked the information on the Internet.
Found need to open PATH_INFO. PATH_INFO seems to be supported after nginx 7.16, just open it in the configuration file.
Open the nginx.conf file and add the rewrite rule to your virtual host, 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;
}
}
About "CodeIgniter framework in Nginx rewrite rules is how" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.