Solve the pseudo-static failure of CodeIgniter. Original address: modified address: 127.0.0.1onsiteabc123.html copy code: IfModulemod_rewrite.cRewrit original address: http: // 127.0.0.1/onsite/index. php/welcome/index/abc123
Modified address: http: // 127.0.0.1/onsite/abc123.html
The code is as follows:
RewriteEngine on
RewriteBase/onsite
RewriteCond % {REQUEST_URI} ^ system .*
RewriteRule ^ (. *) $/index. php? /$1 [L]
RewriteCond % {REQUEST_URI} ^ application .*
RewriteRule ^ (. *) $/index. php? /$1 [L]
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule ^ (. *) \. html $ index. php/welcome/index/$1 [L]
The rule is correct, but CodeIgniter reported that 404 could not find the page. after testing, an html file with the same name in the root directory can be properly displayed;
The problem should be caused by the CI configuration. after some twists and turns, we found a parameter:
The code is as follows:
$ Config ['uri _ protocol'] = 'auto ';
Change it:
The code is as follows:
$ Config ['uri _ protocol'] = 'path _ info ';
The page is displayed normally;
The modified ingress address: http: // 127.0.0.1/onsite/abc123.html code is as follows: IfModule mod_rewrite.c Rewrit...