Web Hosting Talk







View Full Version : Password protected directories


Franki
08-20-2001, 07:22 PM
Hello. I want to make password protected directories. Could someone tell me the data of ".htaccess" file in order to avoid the confict with Frontpage Extensions? 7

joubarani
08-20-2001, 07:47 PM
Try that.

http://www.webhostingtalk.com/showthread.php?s=&threadid=18603

sbrad
08-20-2001, 08:53 PM
To password protect a directory via .htaccess, here's what you'll need to do.
1) Telnet or SSH into your server
2) cd to the directory you want to protect
3) Type: pico .htaccess
4) Paste this in the file, remembering to change the /paths to the .htpasswd file...but I usually just place it in the user's root directory. You can also specify the message you want to show up on the password box where it says "The Secret Directory":
AuthUserFile /home/sites/user/.htpasswd
AuthGroupFile /dev/null
AuthName "The Secret Directory"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

5) Save and exit Pico (ctrl+x, y)
6) cd /home/sites/user (or where ever you specified in .htaccess)
7)Type: htpasswd -c .htpasswd user_name (be sure to change user_name to the correct user name)
8) It will then prompt you for a password. Enter it twice and you're all done!