This question already has an answer here:
I need to add directory protection to one of my folders. It should only be accessible after entering valid credentials.
The folder ist at
/srv/www/vhosts/myproject/errors/protected_folder/ the url is
So I created a
.htaccess file in the target folder with this content:
AuthName 'Enter Credentials' AuthType Basic AuthUserFile /srv/www/vhosts/.htpasswd require valid-user
I generated the .htpasswd file with a random generator found online.
I also tried it with
htpasswd -c /srv/www/vhosts/.htpasswd myuser like described in the documentation.
But if I try to open the site with the above link, then there is no login alert window shown.