RewriteEngine On RewriteCond %{REQUEST_URI} !index\.php RewriteCond %{QUERY_STRING} (.*) RewriteRule ^index\.php$ $1.php [QSA,L]