I wanted to protect a section for subdomain of my website https://domywriting.com/ with a password. For that I would like to use .htaccess, but I did not manage to protect only this one part. My only success was to protect the entire site. For this I had used the following code:
AuthUserFile /users/flashlight-photo/www/domywriting/pass/.htpasswd AuthGroupFile /dev/null AuthName "flashlight_mitarbeiter" AuthType Basic require valid-user
Now my Google search revealed that if I wanted to protect only a part that is in the “protected area” folder and index.html, as well as the entire contents of the “freehand” folder, I should use the following code:
<Directory "/users/subdomain/www/domywriting"> AuthUserFile /users/subdomain/www/domywriting/.htpasswd AuthGroupFile /dev/null AuthName "Protected!" AuthType Basic require valid-user </Directory> <Directory "/users/subdomain/www/freehand"> order allow,deny allow from all satisfy any </Directory> <files index.html> order allow,deny allow from all satisfy any </files>
Unfortunately, this did not work …
I hope you can help me!