RewriteEngine On RewriteCond %{THE_REQUEST} /index\.php/(.+)\sHTTP [NC] RewriteCond %{THE_REQUEST} !-f RewriteRule ^ /%1 [NE,L,R] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ /index.php/$1 [L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?) RewriteRule ^ /%1 [R=301,L] Deny from All