无限星辰工作室-客户无限互联网动力之源
标题:
CodeIgniter 3.0 $config['enable_query_strings'] = true; 默认路由失效解决方案
[打印本页]
作者:
crx349
时间:
2015-10-22 02:11
标题:
CodeIgniter 3.0 $config['enable_query_strings'] = true; 默认路由失效解决方案
当config.php设置为:
$config['enable_query_strings'] = true;
复制代码
默认路由会失效:
解决方法1:
在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;
}
复制代码
解决方法2:
CI 目录下写一个 index.html
<html>
<head>
<meta http-equiv="Refresh" content="0;URL=index.php?c=index">
</head>
<body>
</body>
</html>
复制代码
欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/)
Powered by Discuz! X3.4