I'm trying to set up SSL on a Wordpress site. The SSL certificate does not cover both www. and non-www. versions of the URL, so I'm trying to simply redirect everything to https://domain.tld with RewriteRules. I've scoured Google and found a couple solutions that should work
RewriteEngine on
RewriteCondition %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
Both of these do seem to redirect, but, the page doesn't load. Instead, _index.html_gzip downloads. There are some other mod_rewrite rules present that aren't normally included with the Wordpress htaccess.
I'm not very experienced with mod_rewrite and I'm totally confused at this point.