Although apache configuration is simple and rough, for example, CodeIgniter can directly connect to apache without any configuration, but under a host with small memory, nginx is lightweight enough to cover up its disadvantages that are difficult to configure. If you are using CodeIgniter on nginx and find that all the pages except the homepage are 404, it must be a Rewrite rule error. Online Search
Although apache configuration is simple and rough, for example, CodeIgniter can directly connect to apache without any configuration, but under a host with small memory, nginx is lightweight enough to cover up its disadvantages that are difficult to configure. If you are using CodeIgniter on nginx and find that all the pages except the homepage are 404, it must be a Rewrite rule error. Online Search
Although apache configuration is simple and rough, for example, CodeIgniter can directly connect to apache without any configuration, but under a host with small memory, nginx is lightweight enough to cover up its disadvantages that are difficult to configure. If you are using CodeIgniter on nginx and find that all the pages except the homepage are 404, it must be a Rewrite rule error. Many of the rules found on the Internet seem useless.
Here is a Rewrite rule available for CodeIgniter in nginx (index. php is not removed ).
Location/{if (-f $ request_filename/index.html) {rewrite (. *) $1/index.html break;} if (-f $ request_filename/index. php) {rewrite (. *) $1/index. php;} if (! -F $ request_filename) {rewrite (. *)/index. php ;}}
Original article address: CodeIgniter Rewrite rules under nginx. Thank you for sharing them.