Trouble removing .html URL extension using .htaccess

.htaccess, html, url

Solution

I found this solution elsewhere:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

sources: 1) http://www.catswhocode.com/blog/10-useful-htaccess-snippets-to-have-in-your-toolbox 2) http://eisabainyo.net/weblog/2007/08/19/removing-file-extension-via-htaccess/

Problem

Trying to remove .html extensions from the site using .htaccess. So for example: www.mysite.com/charts.html would become www.mysite.com/charts The following script is in the .htaccess file: ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\.html$ /$1 [L,R=301] ``` But when the url without the .html extension is entered in the browser, it shows a 403 Forbidden error. Any help would be appreciated.

Original source