Is there a way that we can remove .html file extension and move http to https in the same redirect rule so that we do not have multiple redirect chain on the same page.
http -> https -> remove .html
this leads to take more loading time and also has two redirects.
here is htaccess:
RewriteEngine on
#force https+www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule (.*) https://www.%1/$1 [L,R=301,NC]
ErrorDocument 404 /404.html
#Remove .html
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [L,R=301]
RewriteRule ^(.*?)/?$ /$1.html [L]