RewriteEngine On

# Serve existing files and directories directly (css, js, uploads, images)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Everything else goes through the front controller
RewriteRule ^ index.php [L]

# Basic hardening
Options -Indexes
<FilesMatch "\.(sql|md|log)$">
  Require all denied
</FilesMatch>
