AllowOverride All 我把上面的综合了一下:
一.在Apache中修改:
1.加载rewrite.so
2.修改为AllowOverride All
二.在网站中对应index.php的目录中加入.htaccess文件:
写入:
RewriteEngine on
Options FollowSymLinks
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1
第四行表示在CI目录中,如果在网站的根目录中,则为RewriteRule ^(.*)$ /index.php/$1
三.在CI的application/config/config.php中
将$config['index_page'] = "index.php";改为$config['index_page'] = ""; 另外测试rewritebase参数,没有什么作用 终于成功了,谢谢剑雷,太感谢了:) 不知道什么原因,我还是不行,妈的 说说你的服务器环境。
按jianlei的总结做是可以,但又出现了问题
数据读取就没错,可是原先正确的css样式引用找不到文件,编译页面代码是正确的,但是ci却找不到,显示404 Page Not Found
The page you requested was not found.
js文件也是一样!这是不是跟 htaccess文件有关系呢