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

[版本 3.x] CI 3.0 routes的default_controller出现404

[复制链接]
发表于 2015-5-9 21:32:20 | 显示全部楼层 |阅读模式
controllers 增加web文件夹,建立home控制器
目录为:controllers/web/home.php

routes.php 配置 $route['default_controller'] = 'web/home';


http://localhost/ci_article/                                       访问出现404
http://localhost/ci_article/index.php/web/home       页面显示

请问这是什么原因?应该如何解决?

发表于 2015-5-10 02:10:46 | 显示全部楼层
发表于 2015-5-10 15:49:19 | 显示全部楼层
$route['default_controller'] = "web"
然后将你的home function 改成index
默认控制器下的index方法.
发表于 2015-5-11 18:20:54 | 显示全部楼层
你好 ! 你那个问题解决了吗 我现在也和你一样的问题
发表于 2015-5-11 20:48:36 | 显示全部楼层
shuyuchen 发表于 2015-5-11 18:20
你好 ! 你那个问题解决了吗 我现在也和你一样的问题

3楼的朋友说的很明白了呀。
发表于 2015-5-26 13:52:59 | 显示全部楼层
预设路由写成home不就可以了么?

本版积分规则