Skip to content

Instantly share code, notes, and snippets.

@8ctopotamus
Created August 23, 2018 19:53
Show Gist options
  • Save 8ctopotamus/9ca2371b18173c759e00abb957eaaa07 to your computer and use it in GitHub Desktop.
Save 8ctopotamus/9ca2371b18173c759e00abb957eaaa07 to your computer and use it in GitHub Desktop.
Dynamically force HTTPS in .htaccess
# force HTTPS dynamically
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment