PDA

View Full Version : How to remove .php from url?



Kewal Kanojia
12-17-2014, 01:21 PM
Dear Friends,

Please help me.

I want to remove .php From url.
.php replace with .html

Thank You.

george.weballey
12-21-2014, 01:49 PM
You can do it with modrewrite.

In your .htaccess file write this :

RewriteEngine On
RewriteRule ^Profile.\html$ profile.php [L]
RewriteRule ^Contact.\html$ contact.php [L]


Of course you can do it your pages/names you want!

RobMorrow71
12-22-2014, 06:42 AM
You have to add the following code:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)/$ $1.php