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

[讨论/交流] 问一个默认url问题

[复制链接]
发表于 2009-8-30 21:51:11 | 显示全部楼层 |阅读模式
是不是CI默认的

首页url是

http://example.cn/index.php/example/index

如何修改这个啊,,比如说,我想该他为/index/index
发表于 2009-8-30 22:33:16 | 显示全部楼层
 楼主| 发表于 2009-8-30 23:44:48 | 显示全部楼层
谢谢斑竹,
向问一下,
怎么实现在输入 http://example.cn 的时候

自动指向

http://example.cn/index.php/index/index

而不是http://example.cn/index.php/welcome/index
发表于 2009-8-31 08:51:59 | 显示全部楼层
修改application/config/routes.php
$route['default_controller'] = "welcome";
改为
$route['default_controller'] = "index";
发表于 2009-8-31 12:13:47 | 显示全部楼层
其实,控制器最好不要用 index,我的做法是改成 home,这样可以避免一些冲突问题。
发表于 2009-8-31 14:03:01 | 显示全部楼层
http://localhost/CodeIgniter/index.php/register
怎么把URL中的index.php去掉?
发表于 2009-8-31 14:35:04 | 显示全部楼层
 楼主| 发表于 2009-8-31 16:16:24 | 显示全部楼层
修改application/config/routes.php
$route['default_controller'] = "welcome";
改为
$route['default_controller'] = "index";
visvoy 发表于 2009-8-31 08:51



谢谢了。。呵呵呵。。。

本版积分规则