Remove .html from URL

Should you want to remove .html from a URL you can paste the following in your .htaccess file in the root www/public_html directory:

RewriteCond %{THE_REQUEST} \s/+(.+?)\.html[\s?] [NC]
RewriteRule ^ /%1 [R=302,L,NE]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1\.html -f [NC]
RewriteRule ^(.+?)/?$ /$1.html [L]

An example of the above would be as follows:

test.com/somepage.html

would be redirected to:

test.com/somepage