RewriteEngine On

# WWW -> no-WWW
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L,NE,QSA]

# HTTP -> HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE,QSA]

# HSTS
Header set Strict-Transport-Security "max-age=10886400; includeSubDomains; preload"
