Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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