DirectoryIndex index.php
ServerSignature Off

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (^|/)\. - [F,L]
RewriteRule ^(?:config|storage)/ - [F,L,NC]
RewriteRule ^(?:sales_tracker\.sql|generate-hashes\.php|test\.php)$ - [F,L,NC]
</IfModule>

<FilesMatch "(?i)^(\.env|error_log|.*\.log|.*\.sql)$">
  Require all denied
</FilesMatch>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set X-Frame-Options "SAMEORIGIN"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  <FilesMatch "\.(css|js|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$">
    Header set Cache-Control "public, max-age=604800, immutable"
  </FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json image/svg+xml
</IfModule>
