RewriteEngine On
RewriteBase /

# Deny access to hidden files
RewriteRule (^\.|/\.) - [F]

# Allow direct access to existing files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Route everything else through index.php
RewriteRule ^(.*)$ index.php [QSA,L]
