RewriteEngine On # Redirect requests for .php files (as before) RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.php [NC] RewriteRule ^ /%1 [L,R=301] # Internally rewrite requests WITHOUT .php to the actual .php file (explicit) RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI}.php -f RewriteRule ^(.*)$ $1.php [L]