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"
 
Latest Threads
Recommended Threads
Replies
3
Views
2,480
Replies
5
Views
2,367
Replies
9
Views
4,684
Replies
2
Views
2,053
Replies
17
Views
6,604

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