Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Last active December 12, 2017 17:22
Show Gist options
  • Save johnmccole/740988bdcc1e25faac3f49c42fbed88a to your computer and use it in GitHub Desktop.
Save johnmccole/740988bdcc1e25faac3f49c42fbed88a to your computer and use it in GitHub Desktop.
Add either of the following to the domain's .htaccess file.
<IfModule mod_rewrite.c>
# BEGIN Force https to http
RewriteEngine On
RewriteCond %{HTTPS} =on
RewriteRule ^(.*) http://%{HTTP_HOST}/$1 [R=301,L]
# END Force https to http
</IfModule>
<IfModule mod_rewrite.c>
# BEGIN Force http to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R=301,L]
# END Force http to https
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment