Knowledgebase: cPanel Web Hosting
How to enable HSTS (HTTP Strict Transport Security) in your web site
Posted by LankaHost NOC on 12 June 2021 04:24 PM

To enable HSTS (HTTP Strict Transport Security) in your web site, please add following content to your .htaccess file.

 

Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Options -Indexes
(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).