Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add 301 redirect to force SSL on site
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L]
</IfModule>
@sabernhardt

This comment has been minimized.

Copy link

@sabernhardt sabernhardt commented Dec 23, 2017

to make the redirect permanent:
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L]

@jennimckinnon

This comment has been minimized.

Copy link
Owner Author

@jennimckinnon jennimckinnon commented Mar 6, 2018

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