Newbee needs help: CMS Tutorial - Authentication does not work

Hi,
I had a running cakephp1.3 version several years ago and am now trying to built it new with cakephp4.x.

I am working with xampp on windows10 and followed the installation guidelines using composer and “bake all” with my existing database.

The first thing I was trying to add was authentication. I followed the tutorial int he cakephp4 cookbook: https://book.cakephp.org/4/en/tutorials-and-examples/cms/authentication.html

I am stuck at “Test it by requesting any page of your site. After being redirected to the /users/login page, enter the email and password you picked previously when creating your user. You should be redirected successfully after login.”

When requesting any page, I am not redirected to “localhost/MyApp/users/login” but to “localhost/users/login”, which of course gives an error. What is wrong here?

When I am trying to login, I always get the message, username or password are wrong. I tried to check that again, the tutorial suggests:

" If you don’t have a user with a hashed password yet, comment the loadComponent('Authentication.Authentication') line in your AppController and go to /users/add to create a new user picking email and password. Make sure to uncomment the lines we just temporarily commented!"

But when I uncomment the line, I get only error messages and can go to /users/add any more. Is the tutorial wrong or is this a sign, that I did something wrong?

If you intend to run under a subfolder (“MyApp”), there’s likely a bit more configuration that needs to be done somewhere to get everything lined up. Is that a permanent requirement, or just where you’ve got it for initial development? If the latter, I’d strongly suggest that you instead run it in something that mirrors the actual final URL structure that you’ll use when it’s live.

Thank you Zuluru! It is working now.

Is that a permanent requirement, or just where you’ve got it for initial development?

This was just what I used as a default from my previous experience. I have created a xampp subdomain now like will be the case for the productive version.