Merge pull request 'Fix #41: CSP und Security Headers implementieren' (#49) from feature/issue-41-csp-header into main
All checks were successful
Lint / PHP Syntax Check (push) Successful in 33s
Lint / CSS Lint (stylelint) (push) Successful in 1m13s
Lint / HTML Lint (htmlhint) (push) Successful in 1m9s

Reviewed-on: #49
This commit is contained in:
2026-05-22 08:34:34 +02:00

View File

@@ -1,6 +1,14 @@
# Enable rewrite engine # Enable rewrite engine
RewriteEngine On RewriteEngine On
# Security Headers
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; frame-src https://www.google.com/ https://www.google.de/; connect-src 'self'"
</IfModule>
# Legacy redirects (301) must be before the catch-all # Legacy redirects (301) must be before the catch-all
RewriteRule ^impressum\.html$ /impressum [R=301,L] RewriteRule ^impressum\.html$ /impressum [R=301,L]
RewriteRule ^datenschutz\.html$ /datenschutz [R=301,L] RewriteRule ^datenschutz\.html$ /datenschutz [R=301,L]