How to set HSTS headers with .htaccess

There are more “degrees” of HSTS and the headers can be defined in .htaccess as follows: 1 – Just set the HSTS headers and max-age as standard requires: Header always set Strict-Transport-Security “max-age=31536000”   2 – Add the HTTPS environment … Read More

How to redirect HTTP to HTTPS traffic with .htaccess

Open the .htaccess file in the root of your web and add these rules: # HTTPS Redirect RewriteEngine On RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]   The “RewriteEngine On” is needed only once in the .htaccess file, so if … Read More

0