BlueGit

projects-timfalken-com verhalenboek

Files

verhalenboek / web / .htaccess

.htaccess

.htaccess 1.3 KiB Download Raw
1Options -Indexes
2DirectoryIndex index.php
3
4# Apache/PHP-FPM strips the Authorization header by default; pass it to PHP for Bearer API keys.
5<IfModule mod_rewrite.c>
6 RewriteEngine On
7 RewriteCond %{HTTP:Authorization} .
8 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
9</IfModule>
10# No SetEnvIf here: since 2026-10-29 the host rejects it in .htaccess (HTTP 500 for the whole folder).
11# The rewrite rule above already passes the header (bootstrap.php also reads REDIRECT_HTTP_AUTHORIZATION).
12<FilesMatch "^(README\.md|router\.php)$">
13 Require all denied
14</FilesMatch>
15<IfModule mod_headers.c>
16 Header always set X-Content-Type-Options "nosniff"
17 Header always set Referrer-Policy "same-origin"
18</IfModule>
19
20<IfModule mod_mime.c>
21 AddType application/manifest+json .webmanifest
22</IfModule>
23
24# Versioned asset URLs (?v=commit) may be cached for a long time.
25# sw.js is the exception: a service worker is only updated when this URL is revalidated.
26<IfModule mod_headers.c>
27 <FilesMatch "\.(css|js|png|svg|webp|woff2?)$">
28 Header set Cache-Control "public, max-age=31536000, immutable"
29 </FilesMatch>
30 <Files "sw.js">
31 Header set Cache-Control "no-cache"
32 </Files>
33 <Files "manifest.webmanifest">
34 Header set Cache-Control "no-cache"
35 </Files>
36</IfModule>