Hello everybody, i’m having troubles using routing elements. I’m trying to dinamycally redirect any URL in which an action isn’t provided to the view action, but it’s not working, and i’m getting a redirect to my appdefault path, searching the viewController instaed of searching the view action of the actual controller.
To clearify more, in my routes.php I’ve put the following lines
$routes->redirect('/', ['controller' => 'users', 'action' => 'home']);
$routes->connect('/pages/*', ['controller' => 'pages', 'action' => 'display']);
// ...and connect
$routes->redirect('/:controller/', ['action' => 'view']);
so with URL myapp/articles I’m expecting to be redirected to myapp/articles/view
but I’m getting redirected to myapp/view
What am I doing wrong?
Thanks in advance for the support