Options -Indexes
RewriteEngine On

# Deny sensitive files
<FilesMatch "\.(py|yml|yaml|md|log|sh|env|conf|dockerfile)$">
    Order allow,deny
    Deny from all
</FilesMatch>

# Deny tools directory
RewriteRule ^tools/ - [F,L]

# Route homepage and all non-asset, non-api requests through PHP router
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/assets/
RewriteCond %{REQUEST_URI} !^/api/
RewriteRule ^$ /api/router.php?type=coming_soon [QSA,L]
RewriteRule ^(.*)$ /api/router.php?type=coming_soon [QSA,L]

ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
