Options +FollowSymLinks

IndexIgnore */*

RewriteEngine on
RewriteBase /

# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

# otherwise forward it to index.php

RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
