admin Founder


Registrato: Oct 03, 2008 Messaggi: 261
|
Inviato: Dom Nov 16, 2008 8:08 pm Oggetto: Proteggere una cartella con login tramite file htaccess |
|
|
/***************************************************************/
/ Guida creata da Stefano il 08.06.2007 http://www.rtcw.ch /
/***************************************************************/
/ /
/ Questa piccola guida, /
/ serve per proteggere una cartella con il login tramite /
/ file .htaccess e .htpasswd /
/ /
/***************************************************************/
1).
- nel file .htaccess inserire:
AuthUserFile /var/www/vhosts/sito.ch/httpdocs/cartella_da_proteggere/.htpasswd
AuthGroupFile /var/www/vhosts/sito.ch/httpdocs/cartella_da_proteggere
AuthName "Login"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
- modificare questa riga per indicare la cartella da proteggere con il login.
ES:
AuthGroupFile /var/www/vhosts/sito.ch/httpdocs/cartella_da_proteggere
- modificare questa riga per indicare dove si trova il file .htpasswd che creeremo succesivamente.
ES:
AuthUserFile /var/www/vhosts/rtcw.ch/httpdocs/admin/.htpasswd
- la path dei file è diversa, per saperla
- salvate questa codice in un file php e caricatelo nella stessa cartella dove volete proteggere il file con il login.
<?
$path_sito = dirname(__FILE__);
echo "Path del file<br>$path_sito";
?>
2).
- nel file .htpasswd inserire il nome utente e password
- per creare user e password createlo a questo url. http://www.xs4all.nl/~remcovz/htpasswd.html
3).
- caricate tutte e dui i file nella stessa cartella del file da proteggere.
- per creare i file .htpasswd e .htaccess con blocco note.
- creare un nuovo documento di testo e salvatelo e nel "Salva come:" selezionate "Tutti file"
- e nel nome inserite .htpasswd o .htaccess _________________ D3vil-C0de Crew => http://d3vilc0de.org
My Spaces => http://kinginfet.135.it
My Tool Cracker => http://totalcracker.135.it
My Dj Site => http://djkinginfet.135.it |
|