Skip to content

Instantly share code, notes, and snippets.

@luissquall
Last active November 10, 2016 22:56
Show Gist options
  • Save luissquall/f1ef23545955fec35b89 to your computer and use it in GitHub Desktop.
Save luissquall/f1ef23545955fec35b89 to your computer and use it in GitHub Desktop.
Redirect HTTP traffic to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment