573307819 发表于 2015-5-18 10:02:29

CI3.0路由问题

$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都不带还得自己下载安装申请号练级

Closer 发表于 2015-5-18 11:39:31

CI 目錄下寫一個 index.html

<html>
<head>
    <meta http-equiv="Refresh" content="0;URL=index.php?c=index">
</head>
<body>
</body>
</html>

yumu 发表于 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;
}

573307819 发表于 2015-5-18 16:13:25

哎,升级反而问题多了

573307819 发表于 2015-5-18 16:17:56

这个算不算是bug,我把楼上代码放进去果然OK了,谢谢,哎,看来CI3.0还需继续更新版本啊,bug不少
页: [1]
查看完整版本: CI3.0路由问题