RewriteEngine On

# Serve real files/directories (assets) directly.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

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

# Defence in depth in case config/database/storage are ever copied under the web root.
<FilesMatch "\.(sql|log|md)$">
  Require all denied
</FilesMatch>
