Remove .php extensions with .htaccess without breaking DirectoryIndex
snippet in htaccess

Remove .php extensions with .htaccess without breaking DirectoryIndex

user8531

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]