Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Password protect a folder with .htpasswd?

How can I password protect a folder by using .htpasswd?

I would aswell like the username and password to be this:
Username: Skipper
Password: sandmanden
First you'll want to create a ".htpasswd" file that contains the following:
Code
Skipper:25Rknpxf64TbA
The code at the end is just your password encrypted. Don't worry your host will understand this!

Then you make a ".htaccess" file that contains something like this:
Code
AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName "My Protected Folder"
Require valid-user
Change "/full/path/to/" to the path where you placed your .htpasswd file
AuthName is the header that will come up when someone tries to access your protected folder!
Place the .htaccess in the folder that you wish to protect and it should now be password locked.

Note: The .htpasswd does not need to be in the folder that you want to protect, it can be anywhere but you must place the path of where it is in the .htaccess file. The .htaccess MUST be in the folder you want to protect.

Note2: Try and upload .htpasswd to a place that is not publicly accessible (like your root directory) or use CHMOD to change the permissions for that file so no-one can just easily view it.
[Image: AmU3ZAf.gif]

used an online gif maker online to make it and it took forever so it remains
To password protect directory:

1 Login into your cPanel and click on the Password Protect Directories icon, found under Security.
2 Choose Web Root (and you may need to select Show Hidden Files)
3 Click on the name of the directory that you wish to password protect.
4 Check the box for "Password protect this directory:"
5 Fill in "Name the protected directory". Actually, this is just the message that will show to visitors when they try to login, and can be anything you like.
6 Click on Save button below.
7 Click "Go Back"
8 Fill in a Username and Password at the bottom of the page, and click "Add/modify authorized user".

You are done. The directory you selected is now protected by password

Also a Video tuto in Youtube : http://www.youtube.com/watch?v=lqk44fXJF...r_embedded#!


Possibly Related Threads...
Thread / Author Replies Views Last Post
by FearJul 1, 2018 01:20 PM 6 181 Jul 1, 2018 01:20 PM
Last Post: tweety
by Mr. Money™Sep 2, 2017 05:52 PM 4 127 Sep 2, 2017 05:52 PM
Last Post: Mr. Money™
by RushaxSep 28, 2016 07:51 AM 0 104 Sep 28, 2016 07:51 AM
Last Post: Rushax