删除index。php 还是不行!打不开,请教大侠们!!
本帖最后由 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
</IfModule>
做完以上几步还是不行。。跟以前的访问路径一样
http://localhost/ci/index.php/blog(可以)
http://localhost/ci/blog(不可以)
超级无解。。求大侠帮助。。感激不尽!!! .htaccess里我也这么写的,应该是没问题,看看服务器rewrite方面吧…… 你可以了?服务器也改了吖
oadModule rewrite_module modules/mod_rewrite.so
http://localhost/ci/index.php/blog(可以)
http://localhost/ci/blog(不可以)
在本地的可以吗?我在本地的可以。发一个 .htaccess希望对照一下:
RewriteEngine on
RewriteCond $1 !^(index\.php|system\.php|images|img|style|js|ls|skin|captcha|attachment|uc_client|application|api|install|plugins|robots\.txt)
RewriteRule ^(.*)$ /v4/index.php/$1
- -早上回复你这个问题的时候浏览器崩了 ..所以就关机睡了
你这是前面发过帖子? 怎么不继续在原贴上提问
输出phpinfo 搜下看看有没有载入mod_rewrite
如果载入了的话
则试试手册中的.htaccess写法 RewriteRule ^(.*)$ index.php/$1
(ci不是你的根目录 你的根目录是localhost )
http://codeigniter.org.cn/user_guide/general/urls.html sostart 发表于 2012-1-13 23:29 static/image/common/back.gif
- -早上回复你这个问题的时候浏览器崩了 ..所以就关机睡了
你这是前面发过帖子? 怎么不继续在原贴上提问
注意看 在根目录和不在根目录下是两种写法 sostart 发表于 2012-1-13 23:30 static/image/common/back.gif
注意看 在根目录和不在根目录下是两种写法
大大侠,我根目录是localhost?不是ci?。。这我搞布清楚了。。我的application,system是在ci文件夹里面的?怎么看根目录呢?
另外还有。,在不在根目录 分别怎么写。列出来看看吧,谢谢了 xygs888 发表于 2012-1-14 19:49 static/image/common/back.gif
大大侠,我根目录是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
不在根目录RewriteRule ^(.*)$ index.php/$1
同学我只是想看看这个能不能解决你遇到的问题 请同学注意看手册 特别是别人已给过你链接的时候 没用的。。还是访问不到··· 已经解决了。。原来是配置php的问题!谢谢大侠们!
页:
[1]
2