Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maagmirror/f54eb085d005ea637eaaf7e0a8dbbfb3 to your computer and use it in GitHub Desktop.
Save maagmirror/f54eb085d005ea637eaaf7e0a8dbbfb3 to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Header always set Strict-Transport-Security "max-age=31536000"
</IfModule>
#for subdomains
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=10886400; includeSubDomains; preload" env=HTTPS
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment