Managing HTTP Strict Transport Security (HSTS) for your site
HTTP Strict Transport Security (HSTS) protects against several types of malicious attacks. Learn how to protect & setup HSTS for your site!
This article discusses HTTP Strict Transport Security (HSTS) and how to manage it for your site.
About HSTS
HTTP Strict Transport Security (HSTS) instructs web browsers to only use secure connections (https:// ) for all future requests when communicating with a web site. Doing so helps prevent SSL protocol attacks, SSL stripping, cookie hijacking, and other attempts to circumvent SSL protection.
Managing HSTS on Linux
By default, HSTS is enabled on all Linux-based managed hosting accounts. You do not need to take any additional steps to use HSTS with your site.
However, there may be scenarios where you want to disable HSTS for your site, such as during site development or testing. To do this, follow these steps:
-
Using SSH, the cPanel File Manager, or the Plesk File Manager, navigate to the document root of your site (usually the public_html folder).
-
Use your preferred text editor to open the .htaccess file.
Note
If the .htaccess file does not already exist, create it.
-
Copy the following line, and then paste it into the .htaccess file:
Header always unset Strict-Transport-Security
-
Save your changes to the .htaccess file. HSTS is now disabled for your site.
More Information
For more information about HSTS, please visit https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security.
Related Articles
Updated 3 days ago