Last Updated: February 25, 2016
·
488
· middle8media

.htaccess Rewrite to remove the .php from the url

This one comes via my buddy Alex McKinney. Thanks Alex.

Place this in your .htaccess file to remove the .php from the url.

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUESTFILENAME} !-f
RewriteCond %{REQUEST
FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]