解决CodeIgniter伪静态失效
原来地址:http://127.0.0.1/onsite/index.php/welcome/index/abc123
修改后地址:http://127.0.0.1/onsite/abc123.html
<IfModulemod_rewrite.c>
RewriteEngineon
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]
</IfModule>
规则是没有错的,但万想不到CodeIgniter竟然报404找不到页面;经过测试在根目录建立同名的html文件是能够正常显示的;
那问题应该是CI的配置导致的;经过一番波折,发现一个参数:
$config['uri_protocol']='AUTO';
把它改成:
$config['uri_protocol']='PATH_INFO';
页面终于显示正常了;
热门推荐
10 感谢韩语老师祝福语简短
11 升职文案高级祝福语简短
12 花童结婚祝福语大全简短
13 向国庆送祝福语简短
14 什么寄语简短祝福语女生
15 客户回礼祝福语大全简短
16 女孩生日祝福语简短创意
17 家长回复节日祝福语简短
18 给外婆敬酒祝福语简短