ErrorDocument 404 /error.html

RewriteBase /

# Make sure it's not an actual file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f

RewriteRule ^(.*)$ $1.html [L,QSA]

