For my website's .htaccess I currently have:
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
So that when someone visits the page over http they get a 301 and then connect over SSL/TLS. However, this still opens users up to MITM attacks via sslstrip. I noticed that if I go to http://facebook.com in my network log the request gets changed to https://facebook.com before a response comes back, preventing a MITM attack. I was wondering how this was achieved so I can force SSL/TLS better.
Thanks