Options -Indexes
DirectoryIndex index.php
RewriteEngine On

RewriteRule ^(?:app/)?storage/ - [F,L]
RewriteRule ^(?:app/)?(?:app|database)/ - [F,L]
RewriteRule ^(?:app/)?config(?:\.sample)?\.php$ - [F,L]
RewriteRule ^(?:app/)?(?:README|INSTALLATION)\.md$ - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

<FilesMatch "\.(sql|log|ini|env|lock)$">
  Require all denied
</FilesMatch>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>

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

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 7 days"
  ExpiresByType application/javascript "access plus 7 days"
  ExpiresByType image/svg+xml "access plus 30 days"
</IfModule>
