RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteCond %{REQUEST_FILENAME}\.php ^(.*)\.php(.*)$ RewriteRule .* %1.php?%2 [QSA]