Hex 发表于 2008-2-1 01:38:15

你应该把 APACHE 的设置发上来看看!这东西和 CI 关系不大。

analyzer 发表于 2008-2-1 05:30:53

我有些问题和这差不多,url rewrite是成功了,但是访问下级目录时也会转到index.php上,请问这怎么改,让它对下级目录文件不转到index.php上呢

Hex 发表于 2008-2-1 09:41:22

不是有个 RewriteCond $1 !^(index\.php|images|robots\.txt)吗?看看 rewrite 规则,这是判断条件,符合的才 rewrite。前面的 ! 表示非。

tg8866 发表于 2008-2-1 12:49:51

你确定你的.htaccess功能打开了?

AllowOverride All

jianlei 发表于 2008-2-1 13:32:58

我把上面的综合了一下:
  一.在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'] = "";

jianlei 发表于 2008-2-1 13:33:31

另外测试rewritebase参数,没有什么作用

analyzer 发表于 2008-2-1 14:31:45

终于成功了,谢谢剑雷,太感谢了:)

zgs522 发表于 2008-8-30 14:29:26

不知道什么原因,我还是不行,妈的

Hex 发表于 2008-8-31 09:14:39

说说你的服务器环境。

khtml 发表于 2008-9-1 21:59:44

按jianlei的总结做是可以,但又出现了问题

数据读取就没错,可是原先正确的css样式引用找不到文件,编译页面代码是正确的,但是ci却找不到,显示
404 Page Not Found
The page you requested was not found.

js文件也是一样!这是不是跟 htaccess文件有关系呢
页: 1 [2] 3
查看完整版本: 去掉index.php的问题