Skip to content

Instantly share code, notes, and snippets.

@leonkorteweg
Last active July 14, 2016 08:11
Show Gist options
  • Save leonkorteweg/c7cf26f9f81921bf6e4d9868ca8f0769 to your computer and use it in GitHub Desktop.
Save leonkorteweg/c7cf26f9f81921bf6e4d9868ca8f0769 to your computer and use it in GitHub Desktop.
common .htaccess redirects
# HTTP to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://www.yoursite.com/$1 [R=301,L]
# HTTPS to HTTP
RewriteEngine On
RewriteCond %{HTTPS} =on
RewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment