Skip to content

Instantly share code, notes, and snippets.

@cameronjonesweb
Last active February 29, 2020 12:00
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 cameronjonesweb/525413d4602cf242482af9b52fe7e4d1 to your computer and use it in GitHub Desktop.
Save cameronjonesweb/525413d4602cf242482af9b52fe7e4d1 to your computer and use it in GitHub Desktop.
Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment