Tutoriel N° 2cb
Protect folder with htaccess easily
1/ Create a folder protectfolder in your path: /path/website/protectfolder
2/ Create .htaccess
shareannonce@shareannonce:~$ cd /path/website/protectfolder
shareannonce@shareannonce:~$ nano .htaccess
AuthName "shareannonce"
AuthType Basic
#homepage folder
#DirectoryIndex home.php
#Show index listing
#Enable / Disable directory Listing
#Options -Indexes
Options +Indexes
#Show icons with index listing
#Enable / Disable Fancy directory Listing
#IndexOptions -FancyIndexing
IndexOptions +FancyIndexing
#path where is .htpasswd
AuthUserFile /path/website/protectfolder/.htpasswd
#Ignore specific files
#IndexIgnore *.png *.txt
#You can limite user require toto
require valid-user
3/ Create .htpasswd with this line
shareannonce@shareannonce:~$ cd /path/website/protectfolder
shareannonce@shareannonce:~$ htpasswd -c .htpasswd guest
write and confirm the password shareannonce (for this example)
You can use this tools if you dont have ssh to create your .htpasswd file
http://www.htaccesstools.com/htpasswd-generator/
Finally you could access to your protect folder with this login/password ==> guest/shareannonce