565 tutoriels disponibles
Chercher un tutoriel
Bienvenue
sur Shareannonce
 
Protect folder with htaccess easily
Ecrit par: Shareannonce
Date création:  16-02-2019
Nombre de vues:  2128
Catégorie:  informatique > developpement > linux
Note: 
 
   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




 
 
   Autres tutoriels de la même catégorie >
 
ShareAnnonce version 2.0 Tous droits reserves. | Condition d'utilisation | Contact