Table of Contents
Add this to the beginning of your .htaccess file (it might already be there).
RewriteEngine on is added, add two of the following blocks of code directly below it. If you have any
301 redirects, place them after whichever block you choose. None of the text below is a placeholder — in other words, don't change anything about the text. Any text that follows after the number sign (#) is a comment, and can be removed.
Block 1 — protocols
For the first block, we need to specify whether we want our domain to be accessed via http or https.
Redirect to http
Redirect to https
Block 2 — www
We've got everything redirecting to a single protocol, now we'll specify whether we want our domain to use www.