#1  
Old 13th May 2005, 12:41
kermit kermit is offline
Junior Member
 
Join Date: Apr 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default .htaccess / Apache

I want to password-protect a directory with .htaccess. How can I do that?
Reply With Quote
Sponsored Links
  #2  
Old 18th May 2005, 16:32
deedee deedee is offline
Junior Member
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

First, you have to create a file called .htaccess in the directory you want to password-protect:

Code:
AuthType Basic
AuthName "Members Only"
AuthUserFile /path/to/your/.htpasswd
<limit GET PUT POST>
require valid-user
</limit>
Then create the file /path/to/your/.htpasswd which contains the users that are allowed to login and their passwords. You can use the htpasswd command for it:

Code:
htpasswd /path/to/your/.htpasswd user1
htpasswd /path/to/your/.htpasswd user2
...
Obviously you have to adjust /path/to/your/.htpasswd
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:35.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.