How to Make Folder Password Protect using htaccess


0

In this article we see make folder password protected

Add given below in .htaccess file in the folder you want to protect:

AuthType Basic
AuthName "This Area is Password Protected"
AuthUserFile /full/path/to/.htpasswd
Require valid-user

Preferably, the .htpasswd file will be not in a public facing folder. Add this in there:

chriscoyier:$apr1$O/BJv...$vIHV9Q7ySPkw6Mv6Kd/ZE/

That is just an easy, you can generate the code with your unique user and password here.

Note: that all subdirectories of this folder will also be password protected by this same system.

Also Read: How to Remove File Extention from URLs using htaccess


Like it? Share with your friends!

0
Developer

0 Comments