Skip to content

Instantly share code, notes, and snippets.

@incomegems
Created May 6, 2016 12:33
Show Gist options
  • Save incomegems/3149a585819b35aea2ace9aefd401807 to your computer and use it in GitHub Desktop.
Save incomegems/3149a585819b35aea2ace9aefd401807 to your computer and use it in GitHub Desktop.
301 Permanent Redirect from http to https for www - replace www.example.com with your domain
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment