Redirecting all URLs that end in .php to no extension
snippet in htaccess

Redirecting all URLs that end in .php to no extension

user3923

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

# redirect to .php-less link if requested directly
RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.php\sHTTP/.+
RewriteRule ^(.+)\.php $1 [R=301,L]