UnixServerAdmin

Server Administration & Management

How to remove the .html extension from the URLs using .htaccess

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]
===============================

That’s all this will do it.

Advertisements

May 22, 2011 - Posted by | Apache, htaccess | , ,

1 Comment »

  1. Are you psychic? You must be as your writing so correctly fits the questions I possess in mind on this subject matter. I only put a few phrases in the search results and I’m quite fortunate that your piece popped up.

    Comment by amazing water blog | June 16, 2011 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: