Netherlands flag    Let's celebrate .nl's 35-year-old birthday! Register .nl during April 25-30th for only €1 for a year! Learn More

Redirect website to HTTPS

You are here:
< All Topics

The following code can be added to the beginning of your webhosting .htaccess file and is compatible with most if not all website softwares.

# force client to use secure connections only
Header always set Strict-Transport-Security “max-age=300; includeSubDomains; preload”
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301]

Previous My domain got suspended although I paid my invoices
Next Remote payment failure
Table of Contents