RewriteEngine On

# if the requested file or directory exists, serve it directly.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise route to index.php for internal handling
RewriteRule ^ index.php [QSA,L]