34 lines
1.0 KiB
ApacheConf
34 lines
1.0 KiB
ApacheConf
# Nur *.php im Webroot und assets/ sollen direkt aufrufbar sein. Interne
|
|
# Verzeichnisse (Sessions, Mail-Logs, Migrationen, CLI-Skripte, Doku,
|
|
# App-Bausteine, Legacy-DB-Shim) und Konfigurationsdateien mit
|
|
# Zugangsdaten duerfen nicht direkt per URL abrufbar sein.
|
|
|
|
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
RewriteCond %{REQUEST_URI} ^/(var|database|scripts|docs|app|lib)/ [NC]
|
|
RewriteRule ^ - [F]
|
|
|
|
# Konventionelle /sitemap.xml auf die dynamische, host-korrekte Sitemap.
|
|
RewriteRule ^sitemap\.xml$ sitemap.php [L]
|
|
</IfModule>
|
|
|
|
<FilesMatch "^(env\.local\.php|env\.local\.example\.php|\.env.*|composer\.(json|lock))$">
|
|
<IfModule mod_authz_core.c>
|
|
Require all denied
|
|
</IfModule>
|
|
<IfModule !mod_authz_core.c>
|
|
Order allow,deny
|
|
Deny from all
|
|
</IfModule>
|
|
</FilesMatch>
|
|
|
|
<FilesMatch "\.(sql|md)$">
|
|
<IfModule mod_authz_core.c>
|
|
Require all denied
|
|
</IfModule>
|
|
<IfModule !mod_authz_core.c>
|
|
Order allow,deny
|
|
Deny from all
|
|
</IfModule>
|
|
</FilesMatch>
|