How to fix .htaccess error? Keeps asking for authentication

by francisco cueva   Last Updated August 12, 2019 22:04 PM - source

I'm setting up basic http authentication for my subdomain dev Laravel site with .htaccess and .htpasswd.

First, I created my .htpasswd user and password by command htpasswd -bc .htpasswd admin passadmin. Then, my htaccess file with some basic configurations. I placed my .htaccess file on my project directory /home/user/public_html/laravel_project Then .htpasswd file in /home/user/.htpasswds/.htpasswd.

Also in my apache configuration file, I have AllowOverride All

.htaccess code:

AuthType Basic
AuthName "Site Administratrion"
AuthBasicProvider file
AuthUserFile "/home/user/htpasswd/.htpasswd"
Require user admin

After all those configurations, I cleared my cache and tested. At first asks normally for credentials, the login page of my site loads but after i login asks again for htpasswd credentials and throws an ERROR 401 Unauthorized.

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

By the way, I don't have apache logs on this problem.

Is it Laravel/React related? I need aditional configurations? I think i've tried almost anything.

Related Questions

htaccess , htpasswd and error 401

Updated August 05, 2015 18:01 PM

http password protection causing 'too many redirects'

Updated February 23, 2017 16:04 PM

htpasswd not prompting for password

Updated August 14, 2019 12:04 PM

How to improve cross domain page calling/loading

Updated March 26, 2015 07:23 AM