Skip to content

Instantly share code, notes, and snippets.

@WebVooruit
Last active January 28, 2019 13:41
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 WebVooruit/ee29274a06fdc0ea115ea906ade0e446 to your computer and use it in GitHub Desktop.
Save WebVooruit/ee29274a06fdc0ea115ea906ade0e446 to your computer and use it in GitHub Desktop.
.htaccess HTTPS + HSTS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment