RewriteEngine On RewriteRule ^(app|dict|ns|lib)\/|\.cfg$ - [R=404] RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L,QSA] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]