Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: htaccess file not prompting for password |
|
Author |
|
aaronmartin1651
Joined: 08 Aug 2017 Posts: 1 Location: Atlanta, GA
|
Posted: Wed 16 Aug '17 2:52 Post subject: htaccess file not prompting for password |
|
|
I created the following .htaccess file
<Files "index.php">
AuthName "Restricted"
AuthType Basic
AuthUserFile /path/to/file/.htpasswd
Require valid-user
</Files>
I generated a user and password using
sudo htpasswd -c /path/to/file/.htpasswd user password
When I navigate to the ip address it gave the message: "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.
According to all other walkthroughs It would indicate that I should be prompted for user and password but instead it is going straight to the error message. What do I have wrong? I don't need anything complex I just need it to prompt for password. |
|
Back to top |
|
maba
Joined: 05 Feb 2012 Posts: 64 Location: Germany, Heilbronn
|
Posted: Fri 18 Aug '17 19:03 Post subject: |
|
|
Please check whether the directory tree where the .htaccess file resides has AllowOverride allowed.
Here is a code snippet that would forbid .htaccess
Code: |
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
|
I have included the documentation comment from Apache. So you can selectively turn on specific overrides or just do
AllowOverride All |
|
Back to top |
|
|
|
|
|
|