前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CI3.0 默认路由问题 解决办法

CI3.0 默认路由问题 解决办法

作者头像
李维亮
发布2021-07-09 11:25:13
4350
发布2021-07-09 11:25:13
举报
文章被收录于专栏:李维亮的博客

当开查询字符串的时候,参数enable_query_strings 为 true 。首页报错

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

解决办地,修改文件 system/core/Router.php

_set_routing 函数内前面加

代码语言:javascript
复制
// 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;
    }
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016-04-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档