MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: How to remove the .php/.html extensions from the website URL?  (Read 3630 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
Hello folks,

Website URLs looks unprofessional when they comes with extensions like .php/.html. You can remove these extensions using a below lines of code in .htaccess file.

For .php extension :

Quote
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]

For .html extension :

Quote
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [NC,L]

That's all.

Hope this post help you. Enjoy !! :) :)


MilesWeb.com
cPanel Hosting in India - cPanel Hosting in India.

Grab an SSL for your website and SAVE 20% now. Coupon Code SSLSAVE20.

MilesWeb Hosting Forum