Options -Indexes
DirectoryIndex index.html index.php

<FilesMatch "^(router\.php|README\.md)$">
	Require all denied
</FilesMatch>

<IfModule mod_headers.c>
	Header always set X-Content-Type-Options "nosniff"
	Header always set Referrer-Policy "same-origin"
</IfModule>

# PHP endpoints should not be cached.
<IfModule mod_headers.c>
	<FilesMatch "\.(php)$">
		Header set Cache-Control "no-store"
	</FilesMatch>
</IfModule>

# t1256: HTML must be revalidated so new asset hashes take effect.
# Versioned JS/CSS/JSON (see ?v= from src/build.sh) can be cached long.
# The host serves PHP through Apache-style rules; static files may be
# served by nginx and then these FilesMatch rules do not apply — the
# query-string hashes still bust the cache.
<IfModule mod_headers.c>
	<FilesMatch "\.(html)$">
		Header set Cache-Control "no-cache"
	</FilesMatch>
	<FilesMatch "\.(js|css|json)$">
		Header set Cache-Control "public, max-age=31536000, immutable"
	</FilesMatch>
</IfModule>
