RewriteEngine On

# If the requested file or directory exists, serve it directly (CSS, JS, images)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Otherwise route everything to index.php
RewriteRule ^ index.php [QSA,L]

# Security: block access to dotfiles
<FilesMatch "^\.">
    Require all denied
</FilesMatch>

# Disable directory listing
Options -Indexes
