Updated on Mar 13, 2019
Having an SSL certificate for your domain and enabling Drupal 8 to work via HTTPS is important for your website and your visitors. This gives you more credibility and shows your users that they can trust the content on your website and not worry about their personal sensitive information (passwords, credit card numbers etc).
The first thing you will need is to have a valid SSL certificate for your domain. To purchase an SSL certificate, you will have to login to your Client Area and navigate to Orders → Product Addons and select the Personal 256bit SSL Certificate. After that, submit a ticket and our Technical Team will gladly activate the certificate for your domain. Or get a free Let's Encrypt SSL issued for your website via cPanel.
To force the connection via HTTPS you will need to open up the .htaccess file by using your cPanel's File Manager (select show hidden files (dotfiles) or enable this once you are in File Manager via the Settings menu).
Now navigate to the location of your Drupal 8 installation, click on the .htaccess file and the select the Code Edit option.
Find the code line:
RewriteEngine on
And add this code snipped below it:
# Redirect to HTTPS RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
You can also add this line to the end of your .htaccess file if you have other custom rewrite rules that you want to work independently of this one.
Congratulations, you have successfully enabled a secure connection to your website.