How to Password Protect a Directory on Your Website

Faaiza

New member
Joined
Mar 11, 2014
Messages
20
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

New member
Joined
Nov 11, 2014
Messages
706
Points
0
There are different ways you can define in .htaccess or via ssh.
 

Faaiza

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

webdesign

New member
Joined
Jul 5, 2012
Messages
229
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
Joined
Jan 4, 2015
Messages
19
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
Replies
0
Views
590
Replies
2
Views
789

Referral contests

Referral link for :

Sponsors

Popular tags

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