Authentication plugin gives me exception in local environment in cakephp 4.4

When I try to login to the site the Authentication plugin gives me this exception: Login URL /cif/ did not match /cif., this is with wampserver in windows 10, the url is http://localhost/cif/, the route in routes.php is established with this code:

$builder->connect('/', ['controller' => 'Users', 'action' => 'login']);

How can I solve this issue?

Can you please help me with this? I don’t know how to solve this issue.

Re-asking for support for already posted questions won’t give you faster support.

Please remember, this is a support forum purely driven by volunteers. If you want to have faster/better support please contact CakeDC

Besides the fact that your given information doesn’t provide the root cause of your problem.

In a default CakePHP installation where the webroot is mapped to the docroot your / route should be connected to http://localhost, not http://localhost/cif/

I’m sorry to be so insistent but I need to solve this issue as son as possible.
Answering to your comment that the site should point to http://localhost and not to http://localhost/cif/ in http://localhost is the index page of wampserver and when you créate the cakephp project with composer you put the directory where the cakephp files will be downloaded and in my case that directory is cif.
I need to test this site in local and then upload it to a server, so I will appreciate all the help you can give me and won’t annoy you any more

Its not about annoying me or any one else in here. Its more about the fact that you need to learn how to google your problems instead of posting your problems in support forums so other people are solving the problems for you. Thats a very important thing to learn as a developer in general since no one can know everything (and thats fine).

So here is what i did:
All I had to google was wampserver change docroot
and the first link is Change the www root directory on WampServer – Rui Miguel Feio
or How To Change The WWW Root Directory On WampServer | Tutorials24x7

CakePHP expects you to configure your webserver correctly - meaning (as I explained above) that the docroot of your application is set to the webroot folder of cakephp. This is also mentioned in the documentation.

In your case you are installing cakephp via composer create-project cakephp/app cif inside the default docroot of Wampserver.

This of course leads to a URL of http://localhost/cif because wampserver just lists whatever is listed in the given folder and cakephp’s root directory has a index.php which is one of the default files to display for a webserver.

But as you can see in the linked index.php file all it does is load the webroot/index.php.

So you know have 2 options:

  • adjust your webserver to point to the correct folder so you have clean URL’s with the cif part
  • adjust cakephp’s config so it knows it lives inside a subfolder and not in the docroot (which comes with its own sort of problems)

Thank you @KevinPfeifer it didn’t occur to me that the problem was on apache and not in cakephp

I solved it creating a virtual host with wampserver, thank you very much for your help