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

[版本 3.x] CI3.0路由问题

[复制链接]
发表于 2015-5-18 10:02:29 | 显示全部楼层 |阅读模式
$config['enable_query_strings'] = true;,设置这里后既然无法使用$route['default_controller'] = 'site';设置了这里,既然无法默认显示报错,

Unable to determine what should be displayed. A default route has not been specified in the routing file.

必须得要index.php?c=site&m=index地址才行访问,无法设置默认路由

CI3.0尼玛好垃圾,经常有问题,没YII2.0成熟,稳定啊

发表于 2015-5-18 10:36:05 | 显示全部楼层
windows真垃圾 连个WOW都不带  还得自己下载安装申请号练级
发表于 2015-5-18 11:39:31 | 显示全部楼层
CI 目錄下寫一個 index.html
HTML复制代码
 
<html>
<head>
    <meta http-equiv="Refresh" content="0;URL=index.php?c=index">
</head>
<body>
</body>
</html>
 
复制代码
发表于 2015-5-18 12:24:46 | 显示全部楼层
system\core\Router.php   Function _set_routing()内将下面的代码提前放到这个函数内的前面:

// Load the routes.php file.
if (file_exists(APPPATH.'config/routes.php'))
{
     include(APPPATH.'config/routes.php');
}

if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/routes.php'))
{
     include(APPPATH.'config/'.ENVIRONMENT.'/routes.php');
}

// Validate & get reserved routes
if (isset($route) && is_array($route))
{
     isset($route['default_controller']) && $this->default_controller = $route['default_controller'];
     isset($route['translate_uri_dashes']) && $this->translate_uri_dashes = $route['translate_uri_dashes'];
     unset($route['default_controller'], $route['translate_uri_dashes']);
     $this->routes = $route;
}
 楼主| 发表于 2015-5-18 16:13:25 | 显示全部楼层
哎,升级反而问题多了
 楼主| 发表于 2015-5-18 16:17:56 | 显示全部楼层
这个算不算是bug,我把楼上代码放进去果然OK了,谢谢,哎,看来CI3.0还需继续更新版本啊,bug不少

本版积分规则