Mit htaccess eine einzelne Datei mit Passwort schützen

Apache, Lighttpd, nginx, Cherokee
Post Reply
michaelroelle
Posts: 36
Joined: 2003-10-19 16:15
Location: Pfalz
 

Mit htaccess eine einzelne Datei mit Passwort schützen

Post by michaelroelle »

Hallo,

im Topic steht schon mein Problem. Ich benutze Apache2, bekomme bisher aber nur Verzeichnisse geschützt. Weiß jemand einen Weg?

Gruß Michael
bungeebug
Posts: 187
Joined: 2004-04-14 10:08
 

Re: Mit htaccess eine einzelne Datei mit Passwort schützen

Post by bungeebug »

jap .. die Datein die geschützt werden sollen alle in einem Ordner :)
michaelroelle
Posts: 36
Joined: 2003-10-19 16:15
Location: Pfalz
 

Re: Mit htaccess eine einzelne Datei mit Passwort schützen

Post by michaelroelle »

Soweit ich weiss, soll es auch auf einzelne Dateien anwendbar sein.
phillux
Posts: 80
Joined: 2004-03-16 13:47
Location: Münster
 

Re: Mit htaccess eine einzelne Datei mit Passwort schützen

Post by phillux »

Google & Apache-Manual sind Deine Freunde(habe dafür keine Minute gebraucht, um´s zu finden):

http://www.bananajoe.de/htpass.html
http://www.google.de/search?hl=de&q=hta ... uche&meta=
dazu noch
http://httpd.apache.org/docs-2.0/mod/co ... filesmatch
http://httpd.apache.org/docs-2.0/mod/core.html#files
Soll nur eine einzelne Datei vor unberechtigtem Zugriff geschützt werden kommt noch die FilesMatch Direktive hinzu:

Code: Select all

<FilesMatch "dateiname.html">
AuthName "plantage"
AuthType Basic
AuthUserFile /path/to/www/htdocs/password
require valid-user
</FilesMatch>
Gruß, Phil
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Mit htaccess eine einzelne Datei mit Passwort schützen

Post by Joe User »

PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Post Reply