|
本帖最后由 dayrui 于 2013-7-2 12:47 编辑
public function _set_routing()
{
// Are query strings enabled in the config file? Normally CI doesn't utilize query strings
// since URI segments are more search-engine friendly, but they can optionally be used.
// If this feature is enabled, we will gather the directory/class/method a little differently
$segments = array();
if ($this->config->item('enable_query_strings') === TRUE
&& ! empty($_GET[$this->config->item('controller_trigger')])
&& is_string($_GET[$this->config->item('controller_trigger')])
)
当开启enable_query_strings时,controller参数非空时才会解析URL参数,当我们使用directory时url格式为:
index.php?d=admin 这时候不带controller参数,就不会解析路由,导致出现404错误
ci2.x与ci3.0都是这样,在开启enable_query_strings时,直接访问directory出现404,这个是否属于BUG?
|
|