Home » .htaccess » Password Protection with .htaccess

Password Protection with .htaccess

It is very easy to password protect a .htaccess file in a folder or directory. This method is called .htaccess password protection, To protect with the password you need to use two files one is .htaccess and .htpasswd and save it into the folder or directory.

Now you need to add the following code in your .htaccess file.

Once you added the code don’t forget to change the path “/home/user/softaox/secure/.htpasswd” with the full path to your .htpasswd. Now you need to upload the .htpasswd file in some of the specific folder which only contains the username and password.

Following code for .htpasswd.

Here “softaox” allows the user to access the password protected section with the password and here this is the password “9476nIHW7Esgw” to access the file.

Was this article helpful?

Yes No

How can we improve it?


We appreciate your helpul feedback!

Your answer will be used to improve our content. The more feedback you give us, the better our pages can be.

Follow us on social media:

Facebook Pinterest


Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts.

Leave a Reply

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

Back to top