Last active
March 6, 2018 02:24
-
-
Save jennimckinnon/8a6ab1b68d0f9a5674d8 to your computer and use it in GitHub Desktop.
Add 301 redirect to force SSL on site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L] | |
</IfModule> |
I got that from the Codex back when I wrote the article. It looks like they make significant updates to that page since then. I have updated it. Thanks for catching that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to make the redirect permanent:
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L]