Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.


How to Password Protect a Directory with .htaccess?

destroyer Offline referral

Posts: 430
Joined: Jul 2013
Reputation: 3

Senior Member
I have been looking for how to protect website directory with the password but just can't understand how to make it work, you you please explain how to create username and password?
maya Offline referral

Posts: 1,058
Joined: May 2013
Reputation: 34

Posting Freak
It's very easy, follow these steps.

Open notepad and past the code below and save as .htaccess

AuthType Basic  
AuthName "1"  
AuthUserFile 2
require valid-user

In the code above you see 1 and 2

1. Replace with the message that will be displayed to the users. Like "Restricted Area"

2. Replace with the path to the directory where this file is stored .htpasswd. If the file is stored in private directory then enter: /private/.htpasswd

Now we have to create .htpasswd file that will contain our username and password.

Important! Password has to be (MD5) encrypted. The entry should look like this, one username and password per line: victor:12yJ.Of/NQ.Pk

victor is username and 12yJ.Of/NQ.Pk is password.

You can use this tool: .htpasswd Username & Password Generator
buscar pareja gratis, chatear y buscar amigos en chat gratis o ligar. Citas, contactos y encuentros.
destroyer Offline referral

Posts: 430
Joined: Jul 2013
Reputation: 3

Senior Member
Got is working thanks for such an easy tutorial.
surenot Offline referral

Posts: 500
Joined: Jan 2014
Reputation: 16

Senior Member
Maya the tool you posted is not generating correct MD5 Hash password! Try his one: http://www.htaccesstools.com/htpasswd-generator/

User(s) browsing this thread: 1 Guest(s)