参考:StackOverflow Question。CodeIgniter删除类名不起作用
$route['default_controller'] = "homepage";
$route['(:any)'] = "handler/$1";
$route['404_override'] = '';
的网址,
http://localhost/sitename/homepage // Has to me mapped to Homepage controller
http://localhost/sitename/url-with-a-slug //URL with A-Z a-z 0-9 and - other than homepage has to be mapped to handler controller
现在,当$route['(:any)'] = "handler/$1";
在routes.php文件中添加这两种中的网址无法正常工作。
但是没有行,homepage
和handler/url-with-a-slug
模式工作。
如何解决这个问题?
注意:控制器handler.php存在,当$route['(:any)'] = "handler/$1";
行被删除时,http://localhost/handler/url-with-a-slug
工作。
你能解释一下吗? – 2014-09-23 15:02:44
尝试更改在配置文件下看到的其他选项。 – 2014-09-23 15:18:47
在尝试可用选项时,所有重定向到主页。 – 2014-09-23 15:38:20