Redirect all pages with .htm to .html while forcing SSL

Good day.

I want to redirect all files ending with .html from the old side to .html on the new site and also force all traffic to go through HTPPS. This is my attempt and it’s looping (too many redirects).

# Force SSL 
RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Redirect .htm to .html 
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.htm [nc]

That looks to be doing the opposite to what you’re asking.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.