For Magento2 how to apply a redirect rewrite in .htaccess file for all URL’s from .html to /


For Magento2 how to apply a rewrite in .htaccess for all URL’s from .html to / URL structure. The M1 store has .html as the end, the new M2 store has / as the URL ending for all products and categories.

We have tried the below:

############################################
## Redirect .html to /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^((^/)+)/$ $1.html

RewriteCond %{THE_REQUEST} ^(A-Z)+ /((^/)+/)*(^.)+.html(?(^ )*)? HTTP/
RewriteRule ^(((^/)+/)*(^.)+).html$ https://%{HTTP_HOST}/$1 (R=301,L)

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.(a-zA-Z0-9){1,5}|/)$ 
RewriteRule (.*)$ https://%{HTTP_HOST}/$1/ (R=301,L)

But it breaks the checkout and some other parts of the site. Any ideas on how to correct please? Looks to be https error on checkout I think.