Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^update/?$ update/index.php [QSA,L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

RewriteRule ^(?:downloads|forum|members|member|friends|feed|chat|messages|albums|album|profile|post|notifications|communities|community|gifts)(?:/.*)?$ index.php [QSA,L]

RewriteRule ^(?:app|config|modules|storage|themes)/ - [F,L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/update(?:/|$)
RewriteRule ^ index.php [QSA,L]
</IfModule>

<FilesMatch "(^\\.|composer\\.(json|lock)$|README\\.md$|SECURITY\\.md$|VERSION$|EDITION$|DEMO_EDITION$|.*\\.(?:sql|bak|backup|old|orig|save|log|ini|env|dist)$)">
Require all denied
</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 "strict-origin-when-cross-origin"
</IfModule>
