Apache protezione file

lucavalentino

Utente Attivo
15 Lug 2006
114
0
16
Sto tentando di proteggere un file tramite .htaccess e .htpasswd, ma viene sempre Error 500

il file htaccess
Codice:
AuthName "Titolo della finestra del login"
AuthType "Basic"
AuthUserFile "http://localhost/corso/.htpasswd"
Require valid-user	 
<Files ~ "http://localhost/corso/htaccess.html">
Require user studente
</Files>
Codice:
luca:luca
Perchè
 
Le password nel file .htpasswd devono essere appositamente codificate, e nel file .htaccess non ci possono essere URL assoluti. Prova modificando .htpasswd così:
Codice:
luca:/0ZBsEcOUYLF6
E il file .htaccess così:
Codice:
AuthName "Titolo della finestra del login"
AuthType "Basic"
AuthUserFile "/corso/.htpasswd"
Require valid-user	 
<Files ~ "/corso/htaccess.html">
Require user studente
</Files>
 

Discussioni simili