用户
 找回密码
 入住 CI 中国社区
搜索
查看: 5246|回复: 15
收起左侧

[已解决] 删除index。php 还是不行!打不开,请教大侠们!!

  [复制链接]
发表于 2012-1-12 16:56:51 | 显示全部楼层 |阅读模式
本帖最后由 xygs888 于 2012-1-15 11:20 编辑

已经按照大侠们之前方法改了,版本2.10
我改动的地方如下:
$config['base_url']  = 'http://localhost/ci/';
$config['index_page'] = '';

apache2.2 改了httpd.conf:

LoadModule rewrite_module modules/mod_rewrite.so

<Directory />
    Options FollowSymLinks
    AllowOverride all
    Order deny,allow
    Deny from all
</Directory>

还有 .htaccess
在根目录,也就是ci目录里,和index.php 同一目录

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]
      
</IfModule>


做完以上几步还是不行。。跟以前的访问路径一样
http://localhost/ci/index.php/blog(可以)
http://localhost/ci/blog(不可以)

超级无解。。求大侠帮助。。感激不尽!!!
发表于 2012-1-12 21:28:34 | 显示全部楼层
.htaccess里我也这么写的,应该是没问题,看看服务器rewrite方面吧……
 楼主| 发表于 2012-1-13 09:09:06 | 显示全部楼层
你可以了?服务器也改了吖

oadModule rewrite_module modules/mod_rewrite.so

http://localhost/ci/index.php/blog(可以)
http://localhost/ci/blog(不可以)
发表于 2012-1-13 10:20:58 | 显示全部楼层
在本地的可以吗?我在本地的可以。发一个 .htaccess希望对照一下:


  1. RewriteEngine on  
  2. RewriteCond $1 !^(index\.php|system\.php|images|img|style|js|ls|skin|captcha|attachment|uc_client|application|api|install|plugins|robots\.txt)  
  3. RewriteRule ^(.*)$ /v4/index.php/$1 [L]
复制代码
发表于 2012-1-13 23:29:01 | 显示全部楼层
- -早上回复你这个问题的时候浏览器崩了 ..所以就关机睡了
你这是前面发过帖子? 怎么不继续在原贴上提问

输出phpinfo 搜下看看有没有载入mod_rewrite
如果载入了的话
则试试手册中的.htaccess写法 RewriteRule ^(.*)$ index.php/$1 [L]
(ci不是你的根目录 你的根目录是localhost )

http://codeigniter.org.cn/user_guide/general/urls.html
发表于 2012-1-13 23:30:40 | 显示全部楼层
sostart 发表于 2012-1-13 23:29
- -早上回复你这个问题的时候浏览器崩了 ..所以就关机睡了
你这是前面发过帖子? 怎么不继续在原贴上提问

注意看 在根目录和不在根目录下  是两种写法
 楼主| 发表于 2012-1-14 19:49:27 | 显示全部楼层
sostart 发表于 2012-1-13 23:30
注意看 在根目录和不在根目录下  是两种写法

大大侠,我根目录是localhost?不是ci?。。这我搞布清楚了。。我的application,system是在ci文件夹里面的?怎么看根目录呢?
另外还有。,在不在根目录 分别怎么写。列出来看看吧,谢谢了
发表于 2012-1-14 21:31:29 | 显示全部楼层
xygs888 发表于 2012-1-14 19:49
大大侠,我根目录是localhost?不是ci?。。这我搞布清楚了。。我的application,system是在ci文件夹里面 ...

http://loclhost 指向的是你网站的根目录, http://localhost/ci  所以ci是你根目录的下级目录
所以 ci 不是你网站的根目录

然后 手册中说的很清楚 你可以按手册中说的试试,地址:
http://codeigniter.org.cn/user_guide/general/urls.html

手册中的两种写法:
在根目录     RewriteRule ^(.*)$ /index.php/$1 [L]
不在根目录  RewriteRule ^(.*)$ index.php/$1 [L]

同学我只是想看看这个能不能解决你遇到的问题 请同学注意看手册 特别是别人已给过你链接的时候
 楼主| 发表于 2012-1-15 01:47:53 | 显示全部楼层
没用的。。还是访问不到···
 楼主| 发表于 2012-1-15 11:19:18 | 显示全部楼层
已经解决了。。原来是配置php的问题!谢谢大侠们!

本版积分规则