From 1e2f3ff73dfa3f87caab4eb8c5eb516f86fe5bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=99=9A=20PH=E2=91=A6=20de=20Soria=E2=84=A2=E2=99=9B?= Date: Mon, 8 Apr 2019 04:59:17 +1200 Subject: [PATCH] Allow to enable HSTS easily on my server --- .htaccess | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.htaccess b/.htaccess index 39b531a..53dda32 100644 --- a/.htaccess +++ b/.htaccess @@ -6,13 +6,14 @@ RewriteEngine On + # Uncomment if HTTPS is enabled. FYI, HSTS header increases security of your website & SEO + # + # Header set Strict-Transport-Security "max-age=31536000; preload" env=HTTPS + # + # Remove www subdomain in the URL # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] - # RewriteRule ^(.*)$ http://%1/$1 [R=301,L] - - # Force the URL to be https (only if you have an SSL certificate) - # RewriteCond %{SERVER_PORT} 80 - # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] + # RewriteRule ^(.*)$ https://%1/$1 [R=301,L] # Redirect trailing slashes if it isn't a folder RewriteCond %{REQUEST_FILENAME} !-d