Remove PHP from File Extension using Htaccess

Must Read : Remove PHP from File Extension using Htaccess

Recently I wanted to remove the .php from one of my project and I was looking for it and I found many of results which was not working.
So today I brought the one for you which is working great and tested by myself.

To remove php from any url for example http://wearecoders.net/about.php to http://wearecoders.net/about Just add this below code to .htaccess file

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

You are Done 🙂

(Visited 49 times, 1 visits today)

Leave a Comment.