Options -Indexes
DirectoryIndex index.php
RewriteEngine On
RewriteRule ^api(?:/.*)?$ api/index.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

<FilesMatch "^(?:\.env(?:\..*)?|README\.md|package(?:-lock)?\.json|server\.js|router\.php|config\.php|config\.local\.php|Innerworkstationery\.html)$">
  Require all denied
</FilesMatch>

<FilesMatch "\.(?:sql|log|bak|ini)$">
  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 X-Frame-Options "DENY"
  Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
  Header always set Strict-Transport-Security "max-age=31536000"
</IfModule>

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