cakephp routing problem, plugin routing works but not others

让人想犯罪 __ 提交于 2019-12-25 02:59:26

问题


I'm having a strange routing problem with a site I just uploaded, and I've made a number of changes to test what's happening. It doesn't make any sense.

My setup is:

  • I'm using one plugin, which I've included all the routing in the routes.php file.

  • I've also included the routes for two other controllers, 'events' and 'updates'

they look like this:

Router::connect('/login', array('plugin' => 'pippoacl', 'controller' => 'users', 'action' => 'login'));

Router::connect('/logout', array('plugin' => 'pippoacl', 'controller' => 'users', 'action' => 'logout'));

Router::connect( '/events/', array( 'controller' => 'events', 'action' => 'index'));

Router::connect('/updates', array('controller' => 'updates', 'action' => 'index'));

What happens when I try to get to 'events' is that I get an error message saying:

"Not Found Error: The requested address '/Events' was not found on this server."

I've checked the database and it's accessible, through the plugin's model/controller/view.

I've also made sure the model/controllers for 'events' and 'updates' are there.

Can anyone tell me how to trouble shoot this?

Thanks, Paul


回答1:


Do you open /events or /Events? URL-s - except the domain part - are case sensitive.




回答2:


Thanks Sibidiba,

As it turns out this happened because there was a user model and user controller in the application folder as well as the plugins controller. So the routing treated other controllers as if they weren't there.

All fixed now.

Cheers, Paul



来源:https://stackoverflow.com/questions/2489910/cakephp-routing-problem-plugin-routing-works-but-not-others

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!