Currently I am trying to setup my apache server for HSTS. Therefore my .htaccess looks like this:
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header set Cache-Control "no-store, no-cache, must-revalidate"
</IfModule>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Now every request contains a "Strict-Transport-Security" header. But in some forums I have read that no HTTP request may contain an HSTS header. Therefore the order should be like this:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header set Cache-Control "no-store, no-cache, must-revalidate"
</IfModule>
But if I do this it seems like I can not add my site to the HSTS preload list on https://hstspreload.org/ because it says "no HSTS header present". So which one is correct?