Hidding .html extension

147 views
asked May 8, 2012 in General by rooby (560 points)
Hi all,
is it  possible to hide .html extension by writing command in  .htaccess .For or example, if  my web page address is  www.example.com/dedicated.html I want it to show as www.example.com/dedicated
How can  do that? I would really appreciate your help in this.
thanks

2 Answers

0 like 0 dislike
answered May 8, 2012 by dona (4,540 points)
this code will do the trick
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
0 like 0 dislike
answered May 8, 2012 by WebGuru (9,280 points)
...