Remove PHP Extension from URL Using Htaccess URL Rewrite Rule

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

In this above code we have used the Rewrite Rule and removed the .php extension from all the URL which fulfill the rule.

No comments:

Post a Comment