Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here are some instructions on how to use the .htaccess method of protecting files and directories. It can be pretty simple to do.

The system requires two files -- the .htaccess file and .htpasswd file.

The .htaccess Code


AuthType Basic
AuthName "restricted area"
AuthUserFile /var/www/html/protect-me-dir/.htpasswd


The above code protects a directory called "protect-me-dir" inside of the html directory. Be sure to use the correct folder path for your account type.

The .htpasswd Code