Skip to content

Instantly share code, notes, and snippets.

@incomegems
Created May 6, 2016 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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