How to Password Protect a Directory on Your Website

Faaiza

New member
Registered
Joined
Mar 11, 2014
Messages
11
Points
0
Hello,

Does anyone know ways how to password protect a directory on your website?
I would like to know ways do it manually
My hosting is running apache web server, PHP and htaccess...

please guide me
 

Hassan

Well-known member
Registered
Joined
Nov 11, 2014
Messages
433
Points
0
There are different ways you can define in .htaccess or via ssh.
 

Faaiza

New member
Registered
Joined
Mar 11, 2014
Messages
11
Points
0
Faaiza
Do you know how to do that? please guide me step by step
 

webdesign

Well-known member
Joined
Jul 5, 2012
Messages
120
Points
0
webdesign
Create a .htaccess file with following information

Code:
AuthName "Please login to secure folder"
AuthType Basic
AuthUserFile /path/to/your/folder/.htpasswd
require valid-user
Note that you should put .htpasswd in account folder outside of directories that can be accessed by your visitors

For example:
Code:
/path/to/your/yourdomain.com/.htpasswd
Ok now you will set up the password File, .htpasswd

in file, you type
Code:
usename1:password1
usename2:password2
You can send account with usenname1 and pasword1 to user 1 and same to user 2

finally chmod 644 for .htpasswd file

Hope it helps!
 

Quadrivium

New member
Registered
Joined
Jan 4, 2015
Messages
13
Points
0
The password, shown above in the previous post, has to be encrypted. You can use the "htpasswd" command in Linux or find an online .htaccess password generator. Just search Google for ".htaccess Password Generator"
 
Recommended Threads
Replies
1
Views
3,513
Replies
1
Views
2,074

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top