Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Remove index file extensions from URL  (Read 2329 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Remove index file extensions from URL
« on: April 05, 2014, 08:59:51 pm »
Its better to hide the index file extension as part of security. We can do this by adding few parameters on respective htaccess files.


1) How to remove the.php extension from the URL?


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

2) How to remove the.html extension from the URL ?

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

Cheersss!!!!!!!!!!!!!  :) :) :) :)