0

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.

1 Answers1

0

enable rewite-log with loglevel of at least 4, and check, what happend during rewrite. check your access-log too with tail -f to see your request. after this you should be able to analyze better.

your rewrite-rules seems ok for the redirects.