Skip to content

Instantly share code, notes, and snippets.

@luclu7
Last active September 17, 2017 08:45
Show Gist options
  • Save luclu7/ecebfa53ba52ba4d8d92e212f70ef21e to your computer and use it in GitHub Desktop.
Save luclu7/ecebfa53ba52ba4d8d92e212f70ef21e to your computer and use it in GitHub Desktop.
Force https (put this file to the root of your web server or in a specific folder)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment