0

I want to have htaccess ask for password on my entire site. However one subdirectory (folder1, which has WordPresss installed) should ask for a different login information (userY).

When I remove the auth thing from htaccess in the main folder everything works perfectly fine, but when I have it added I am being infinitely asked for user authentication when I am doing anything in folder1/WordPress.

My directories look something like this:

- folder1
-- wp-admin
-- wp-content
-- wp-includes
-- .htaccess
-- other wp php stuff
- folder2
- folder3
- index.html
- .htaccess
- .htpasswd

My .htaccess for main folder looks like this:

AuthUserFile /home/sites/www.website.at/web/.htpasswd
AuthName Admin
AuthType Basic
Require user userX
AuthGroupFile /home/sites/www.website.at/web/.group

My .htaccess in folder1 looks like this:

AuthUserFile /home/sites/www.website.at/web/.htpasswd
AuthName Admin
AuthType Basic
Require user userY
AuthGroupFile /home/sites/www.website.at/web/.group

I expect it to ask for UserX in folder2, folder3 and main folder (This part works). I expect it to ask for UserY in folder1, but without giving me an endless loop for authentication.

1 Answers1

0

ChatGPT solved the question.

The AuthGroupFile /home/sites/www.website.at/web/.group which my Provider automatically added to the .htaccess was not necessary, because I didn't use groups. Because I didn't use groups, there was no .group file.

bueltge
  • 2,294
  • 1
  • 29
  • 40