Password Protect Website using .htaccess file


htaccess password protection can be very useful sometimes when we want only authorized users to access a certain webpage.

This can be achieved easily by creating two files :

  • .htaccess
  • .htpassword

You can create the username password file from this link :

.htaccess file

AuthType Basic
AuthName "Password Protected Area"
Require valid-user

We will be using username and password as :
username : letstrythis
password : pass123

.htpassword file


Follow this video for complete guidance :


ALSO READ  SVG Animation using GreenSock (gsap.min.js)

Comments are closed.