Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Apache => Nur bestimmte Dateiendungen freigeben

Empfohlene Antworten

Hallöchen!

Möchte auf nem Apache nur bestimmte Dokumente freigeben und den rest grundsätzlich sperren.

FREI: html, htm, php, inc, gif, jpg, png

GESPERRT: Der Rest, z.b. doc, xls, exe, etc.....

Die Files-Dirictive lässt sich meines wissens nach per .htaccess ändern.

httpd.conf


<Files ~ "^\.*">

    Order allow,deny

    Deny from all

</Files>


<FilesMatch "^\.(htm?|php?|gif|jp?g|png|inc)$">

    Order deny,allow

    Allow from all

</FilesMatch>

Jemand ne Idee oder nen Rat? Diese spontane Lösung klappt nicht und auch weiteres herumtüfteln hat mich schon einige Zeit gekostet...

Gruß

oscha

<FilesMatch "^\.(htm?|php?|gif|jp?g|png|inc)$">

Das wird so nicht funktionierten, da das ^ am Anfang besagt, dass der Dateiname mit einem Punkt beginnen und er, ohne weitere Zeichen zu beinhalten, wegen des $ mit einer Deiner Erweiterungen enden muss.


<FilesMatch "\.(html?|php[345]?|gif|jpe?g|png|inc)$">

das:


<Files ~ "\.*">

    Order allow,deny

    Deny from all

</Files>

...sperrt mir alles, so weit ok. nur mit der freigabe habe ich noch probleme. dein lösungsansatz funktioniert leider auch nicht.

:confused: <-- me

Also bei mir geht das so:


<Files "*">

	Order Deny,Allow

  Deny From All

</Files>


<FilesMatch "\.(html?|php[345]?|gif|jpe?g|png|inc)$">			

	Allow From All

</FilesMatch>

Das Problem könnte jetzt noch der Zugriff auf's Verzeichnis ohne Dateiangabe darstellen...

Der wird jetzt auch verboten...

Das Problem könnte jetzt noch der Zugriff auf's Verzeichnis ohne Dateiangabe darstellen...

Der wird jetzt auch verboten...

yeah, danke! es klappt, wie ich es mir vorstelle!

jemand ne idee, wie das DirectoryIndex (index.html index.htm index.php) ausgegeben werden kann, da wie schon erwähnt es momentan gesperrt ist?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.