Friday, June 14, 2013

remove the .html / .php extension from the URL’S ?

If you want to remove the .html extension from URL’s then just add the below code in the .htaccess file :
======================
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $index.html [NC,L]
======================

If you want to remove the .php extension from URL’s then just add the below code in the .htaccess file :
======================
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $index.php [NC,L]
======================

No comments:

Post a Comment