Php 控制器大写的CodeIgniter中的URL路由
我有一个控制器Php 控制器大写的CodeIgniter中的URL路由,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我有一个控制器Mycontroller.php,类Mycontroller扩展了CI_Controller,我想路由index函数以获取参数,所以我在config/routes.php中这样路由它:$route['Mycontroller/(:any')='Mycontroller/index/$1' 在我更改url中控制器名称中任何字符的大小写之前,一切都很好 示例:http:/localhost/mysite/Mycontroller/argument 这是可行的,但: http:/loca
Mycontroller.php
,类Mycontroller扩展了CI_Controller
,我想路由index函数以获取参数,所以我在config/routes.php
中这样路由它:$route['Mycontroller/(:any')='Mycontroller/index/$1'代码>
在我更改url中控制器名称中任何字符的大小写之前,一切都很好
示例:http:/localhost/mysite/Mycontroller/argument
这是可行的,但:
http:/localhost/mysite/mycontroller/argument
没有
请注意,我是如何更改控制器名Mycontroller
中的M大小写的,现在这显示了404错误,控制器名的所有字符都会出现这种情况,如果我将其保持与类声明中的完全相同,则它会起作用,否则就是404错误
我该怎么做才能使它与大写和小写的任意组合一起工作
另外,问题只出现在重新路由的控制器上。尝试解决方案。尝试解决方案。