SetEnv no-gzip 1 # Preferably use the checkbox in the control panel. RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains" # Testing with https://en.internet.nl/ # Explanation with https://hostingtool.nl/server_headers # Using www. in the redirect is more future-proof. # Redirect 302 / https://example.com/ Redirect 302 / https://www.example.com/ Redirect 302 /.well-known/security.txt https://janwillemstegink.nl/.well-known/security.txt # After such redirecting, code for Wordpress can rewrite, if applicable.