Solved Problem with Protected Directories

PedroPH

Verified User
Joined
Mar 23, 2022
Messages
10
Hello,

I'm having problem using Protected Directories, all files are generated, .htaccess and .htpasswd.

When accessing the directory, the login and password screen is presented, adding the access data to the page does not change and returns to the access screen again.

any tips that might help?
 
And you're sure you entered the correct credentials?

If yes, you have to double check the files themselves, could be a bug or something else.

If you think you entered the credentials correctly, can you show the content of the .htaccess file here?
You can mask the user and domain name for example user for the username /user or /account and for the domain you can use domain.com or example.com or something.
 
Hello, Thanks for the feedback.

credentials is correct.

AuthGroupFile /dev/null
AuthType Basic
AuthUserFile /home/********/domains/********/.htpasswd/public_html/phonak/php/.htpasswd
AuthName "**********"
require valid-user
ErrorDocument 401 "Unauthorized Access"
 
Removing password protection from a directory, Under Security Settings, clear the Password protect this directory check box
 
Check this file if it contains the username you provided on creation and an encrypted password:
AuthUserFile /home/********/domains/********/.htpasswd/public_html/phonak/php/.htpasswd
 
Check this file if it contains the username you provided on creation and an encrypted password:
AuthUserFile /home/********/domains/********/.htpasswd/public_html/phonak/php/.htpasswd
The .htpasswd file was generated normally with user content and encrypted password.

Removing password protection from a directory, Under Security Settings, clear the Password protect this directory check box
Hello,

But I want Protected Directories to work with username and password, but it doesn't.
 
Ok I just tested and on my system it works.

Have you tried with another browser? To really exclude it can't be caused by cache or by some addon or extension?
Is there another .htaccess in place somewhere, maybe in the root folder? Maybe some redirect can create conflicting settings.
And you can also check the domain logfiles to see what it says.
 
Thanks for helping.

The problem has been resolved.

The problem was presented in 2 domains.

One of them came migrated from cPanel, for some reason the creation of protected directories did not come correctly or not well identified.

So I renamed the .htpasswd directory to .htpasswd_old and recreated the whole process, this way it worked fine.


The Other domain I followed your tip and searched directory by directory in search of .htaccess and .htpasswd files, this way it was found in a directory previous to the one that should be protected a .htpasswd, with access data.

Example:
/home/********/domains/********/.htpasswd/public_html/phonak/php/.htpasswd < - Correct
/home/********/domains/********/.htpasswd/public_html/phonak/.htpasswd < - Incorrect | This file I removed

Hope this helps anyone else who has the same problem.

Thanks again.
 
Back
Top