How to Password Protect a Folder on Your Hosting Account

The following files have to exist in the root of the folder you want to password protect:

  • .htaccess
  • .htpasswd

Contents of your .htaccess file

The following lines need to go into your .htaccess file

AuthType Basic AuthName “restricted area” AuthUserFile /path/to/the/directory/you/are/protecting/.htpasswd require valid-user

.htpasswd Username & Password Generator

Use this useful password generator for your .htpasswd file: pwd generator. Simply fill in the fields and then copy/paste the result into a .htpasswd file.

Nina Young About the author

I studied mathematics at university, taught myself software development, honed my skills with multinational companies such as IBM and have set up and sold my own businesses. My perspective covers the all important period when a business moves from small and successful to substantial and market-leading, and my personal experience allows me to provide online solutions that give business leaders mastery of their online presence and control over business development.

No Comments

Post a Comment