When I enter to the site (url: www.facultad.efn.uncor.edu/sistemas/trayectos/) I want to be redirected to controller Users and action login, but when I enter it gives me the error ForbiddenException, the route configured in routes.php is $builder->connect(’/’, [‘controller’ => ‘Users’, ‘action’ => ‘login’]);
I have never not used the .htaccess files. Honestly not sure how it would work without them. I think you’d need to always include index.php in the URLs for that to work?
If the URL doesn’t request a file exactly via its path + filename (like CSS/JS/images/other static files) then put every request through the index.php which basically starts CakePHP
But to come back to the ForbiddenException problem:
Have you added your Users login function to the beforeFilter function like the tutorial says?
public function beforeFilter(\Cake\Event\EventInterface $event)
{
parent::beforeFilter($event);
$this->Authentication->addUnauthenticatedActions(['login']);
}
And if you have the Authorization Plugin enabled as well did you add
Please put the .htaccess files back, as they come, and then let us know what you get when you go to the /users/login URL that I asked about before. What I’m trying to learn from that is whether it’s actually the login action that’s forbidden, or if there’s something else about your setup that’s not right.
Also, the output of bin/cake routes wouldn’t hurt, to ensure that you don’t have something else routed to / that’s taking precedence over the login route you’ve added.