HTACCESS to Remove/Hide PHP from URL that WORKS!!

Despite LOTS of WRONG, Unreliable Advice on the Internet on How to Remove/Hide the .PHP Extension from a Web Page URL Using HTACCESS, THIS Method of Removing PHP Extension with HTACCESS Actually Works!!

Home Short:

If your website files end with the .php extension, by default, the .php appears at the end of your web page urls.

To PROPERLY configures your htaccess file so that php extensions on your web page files are hidden ...

  1. If you have your web servers stored locally on your computer, double click to open the .htaccess file. If your websites htaccess file is on your web server only, download the htaccess file using an ftp program like filezilla, then double click it to open it..
  2. Copy and paste the htaccess code below into the htacess file.
  3. Save the htaccess file as .htaccess and upload to your web server at the location/directory you downloaded from.
Webpage Url With Php Extension Showing Before Htaccess Change
Webpage Url With Php Extension Showing Before Htaccess Change
Webpage Url With Php Extension Showing Before Htaccess Change
Webpage Url Without Php Extension Showing After Htaccess Change
Webpage Url Without Php Extension Showing After Htaccess Change
Webpage Url Without Php Extension Showing After Htaccess Change

An Incorrect HTACCESS Modification to Hide the PHP Extension of your Web Pages

This code is the code most frequently advised online when you search for how to edit the htaccess file to hide or remove the php extension on web pages ...

Perhaps this htaccess code entry works on some websites but according to the online feedback, more often than not, this method does NOT work. I would advise using the first htaccess code edit listed above so in case you ever change web servers, the incorrect htaccess code won't "break" your website..

S
H
A
R
E