Questions tagged [.htpasswd]

.htpasswd is a flat-file used to store usernames and password for basic authentication of Apache HTTP Server.

.htpasswd is a flat-file used to store usernames and passwords for basic authentication on Apache HTTP Servers. The name of the file is given in the .htaccess configuration, and can be anything, but ".htpasswd" is the canonical name. The file name starts with a dot, because most Unix-like operating systems consider any file that begins with dot to be hidden.

This file is often maintained with the shell command htpasswd which can add, delete, and update users, and will properly encode the passwords for use (so they are easily checked, but cannot be reversed back to the original password).

The file consists of rows. Each row corresponds to a username and hashed password pair, separated with the colon. For example:

user:password

The hashed password is typically "UNIX crypt" style, encrypted in either MD5 or SHA1 as common alternatives.

Additional users can be added by using the htpasswd shell command or by appending new lines to the file. For example:

user1:password1
user2:password2

Resources available on the Apache HTTP server can be restricted to users listed in the files created by htpasswd.

See also

526 questions
1
vote
0 answers

How often does a browsers memory of the htaccess/htpasswd password reset?

I'm making a games website for me and my friends. Its just a load of flash files dumped in a folder. I want to password protect this folder. so my question is, how long does the browser remember the password? take into consideration that all (afaik)…
1
vote
0 answers

.htaccess keeps redirecting to 401

I've been trying to get this to work for an hour. I'm protecting a directory with .htaccess and .htpasswd AuthType Basic AuthName "Access Denied: Please Enter the Correct Information to Continue" AuthUserFile…
Casey Dwayne
  • 2,142
  • 1
  • 17
  • 32
1
vote
3 answers

htaccess authentication not using htpasswd

I have an .htaccess file that looks like this: AuthUserFile /etc/.htpasswd AuthType Basic AuthName "Restricted Client Area" Require user admin In the /etc/.htpasswd file I have a single entry for a user called admin that was created via the…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
2 answers

Protecting a directory using .htaccess and .htpasswd

I want to protect an admin folder in my PHP web site from other people. I created two files .htaccess and .htpasswd, but when I enter to the index page on this folder it doesn't show me that dialog where I have to enter the username and the…
Aimad Majdou
  • 563
  • 4
  • 13
  • 22
1
vote
1 answer

.htaccess rewrite but exclude password-protected directory results in 404 error

I have a pretty URL setup with .htaccess that rewrites non-existent URLs (not strictly 404 errors) to a PHP script that serves either content or a 404 message. I have excluded existing files and directories from this rewriting so that CSS, images,…
mattdotre
  • 143
  • 1
  • 9
1
vote
0 answers

iOS won't load content from htaccess / htpasswd-protected subdomains

Because my site is in an early beta-stage, I have added a htaccess-protection to it to prevent random users, searchbots etc. to see the (unfinished) page. I did it like this: AuthName "Restricted Area" AuthType Basic AuthUserFile…
Raphael Jeger
  • 5,024
  • 13
  • 48
  • 79
1
vote
1 answer

htpasswd: wrong credentials created

I was trying to setup svn on a machine running Linux Fedora 18. I created and added new users by using htpasswd. So basically what I did was: $ htpasswd -c passwd admin. where passwd is the file containing the username/password pairs. By default,…
Russell'sTeapot
  • 373
  • 2
  • 11
  • 21
1
vote
2 answers

Redirect all traffic to holding page unless logged in using .htaccess

I currently have a landing page setup on my domain.com which already receives traffic. It will shortly be replaced with an online store. I need to upload this store to my live server in order to get it approved by the Merchant Facility Providers…
F3CP
  • 730
  • 5
  • 17
1
vote
0 answers

Native Mobile App Secure Bridge to Hosted Content

I would greatly appreciate some help with the following problem. I am attempting to build an app with HTML/CSS/JQM that I plan to wrap with PhoneGap to package as a native app for deployment on Android & iOS Platforms. The app will be basically a…
Mike
  • 11
  • 1
1
vote
1 answer

How to allows access to a folder with htaccess

I have an htaccess to prevent access to a folder. Howerver, I would like to one subfolder is allowed to be accessed. Here is my htaccess file. How can I modifiy it to AuthName "Private Zone" AuthType Basic AuthUserFile…
pierrot10
  • 129
  • 4
  • 13
1
vote
1 answer

.htaccess & .htpasswd not accepting login data

I'm trying to password protect my website: http://www.massmindmanipulation.com I've created a .htacces & a .htpasswd file, and the login box pops up when I visit the website. But when I enter the login information, the box quickly disappears and…
1
vote
2 answers

.htaccess: Different AuthUserFile paths for different hosts

I am developing an application that has to run both locally as well as on a remote server. One directory is protected using an htpasswd file. This how I have to define the path to the htpasswd file in the htaccess file: AuthUserFile…
Louis B.
  • 2,348
  • 1
  • 29
  • 51
1
vote
2 answers

Best way to have different .htaccess files for different servers?

I have a website under source control (Git) and using two branches for two different servers. The master branch reflects the production website, and the develop branch is what’s deployed to our test server. However, the test server is…
Martin Bean
  • 38,379
  • 25
  • 128
  • 201
1
vote
0 answers

Protect a "Friendly URL" with .htaccess

I would like to protect a "friendly url" that i have in my htaccess file. Just to be a little bit more clear, i have these rule: RewriteRule ^([a-z|A-Z|0-9|\/|\-|\_]+)$ index.php?page=$1 That redirects url/test/hello to…
1
vote
0 answers

Missing 'WWW-Authenticate' header for 401

I have a project which is protected by std AuthUserFile-directive in .htaccess. Everything is quite simple and has already been fine on another server. Here is the content of my .htaccess: The .htaccess: AuthName "Adminbereich" AuthType…
Ron
  • 1,336
  • 12
  • 20