How To Remove PHP Extension From URL Using .htaccess

How To Remove PHP Extension from URL

If you want to remove remove .php extension from url then first open .htaccess and past this code below.

Remove PHP Extension from URL

Copy and paste code:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]

For more information about how to remove php extension from url using .htaccess contact Websolindia Indian web development company.

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *