Make your server folder password protected.

If you want to make your site a password protected. This can be mainly used for under development sites. You want only limited users (admin) should assess the site till it’s on development phase.

You can do this by adding just few lines in you .htaccess file in the directory you are trying to protect.

 

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

You have to create username and password code online from Htpasswd Generator. You’ll get one line code after generating. Like below:

ranjeet:$apr1$hssaFWCt$pNUe2ixRl.Qm5v84eaTWi/

 

Just put that generated line in your .htaccess file.

Enjoy Coding!!

Written by Ranjeet Jha

Ranjeet Jha

Hey there! My name is Ranjeet. I’m a Web Designer & Front-end Developer. I design, code, build & promote all things HTML5, CSS3, JavaScript & jQuery. In this blog you will find solutions of day to day problems faced by you.. Enjoy Coding..

Leave a Reply

Your email address will not be published. Required fields are marked *