RewriteEngine On

# Allow direct access to existing files (css, js, images, php)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

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