228点六 发表于 2014-2-18 23:18:32

去掉index.php,为什么还有一个index?

刚开始默认的url是http://localhost:8080/CI/ci/index.php/index
然后去掉了红色部分,后面蓝色部分无论怎样都去不掉,是什么?怎么去除?
后来伪静态静态后,还一直保留
http://localhost:8080/CI/ci/index/about_us.html
http://localhost:8080/CI/ci/index/contact.html

怎么办?已经折腾一晚上了

一叶扁舟 发表于 2014-2-19 11:02:38

:L那个是控制器吧……

kissgxd 发表于 2014-2-19 11:36:06

使用rewrite去掉的确实是index.php
使   http://localhost:8080/CI/ci/index.php/index/about_us.html
变成http://localhost:8080/CI/ci/index/about_us.html
后面这个index是控制器
如果想去掉的话 建议你看看“URI 路由”的设置
这个在手册的http://codeigniter.org.cn/user_guide/general/routing.html
按着规则配置下试试

228点六 发表于 2014-2-19 19:12:52

kissgxd 发表于 2014-2-19 11:36 static/image/common/back.gif
使用rewrite去掉的确实是index.php
使   http://localhost:8080/CI/ci/index.php/index/about_us.html
变成 ...
不是控制器。

新建about us页面,代码如下:

<div    id="menu"><div    id="menumain">
<ul>
<li><?php echo anchor("index","Home");?></li>
<li><?php echo anchor("index/about_us","About us");?></li>
<li><?php echo anchor("index/contact","Contact");?></li>
</ul>
</div></div>


这个蓝色字体就是这里面的index,我试过了,如果去掉,url里面就可以去掉index,但是改后就报404。

yuvista 发表于 2014-2-19 23:59:55

目录 或者是 控制器
页: [1]
查看完整版本: 去掉index.php,为什么还有一个index?