Options -Indexes
DirectoryIndex index.html
AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(data|\.git)(/|$) - [F,L]
RewriteRule ^api(/|$) api.php [L]
RewriteRule ^admin/?$ admin.html [L]
RewriteRule ^project/ project.html [L]
</IfModule>

<FilesMatch "^(config\.php|default_config\.json|README\.txt|\.htaccess)$">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
    Deny from all
  </IfModule>
</FilesMatch>

<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "DENY"
Header always set Referrer-Policy "same-origin"
Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' https: data:; connect-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'"
<FilesMatch "\.(html|css|js)$">
  Header set Cache-Control "no-cache"
</FilesMatch>
<FilesMatch "\.(jpe?g|png|webp|svg)$">
  Header set Cache-Control "public, max-age=86400"
</FilesMatch>
</IfModule>
