How to create a redirect that appends .html

How do I create a redirect that adds .html to urls entered. My pages have the following format


domain.com/page-name.html

It looks like some people are leaving off the .html and then being redirected to the home page. Is there a way to check if there is a page with the url they entered + .html ? If there is a page name with url+html redirect to that otherwise redirect to homepage.

The htaccess rewrite rule might look something like this:

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ /$1.html [R=301,L]

thanks jeff! that works perfect.