How to Enable SSL in Drupal 8

Overview on how to establish an encrypted connection to your Drupal 8 website

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).


To activate SSL in Drupal 8, you need to complete the following steps:

Step 1 Obtain SSL certificate

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.


Step 2 Force SSL

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).


Accessing the FIle manager via cPanel


Now navigate to the location of your Drupal 8 installation, click on the .htaccess file and the select the Code Edit option.


Editing the htaccess file of Drupal 8


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.

Drupal 8 Hosting

  • Free Drupal 8 Installation
  • 24/7 Drupal 8 Support
  • Free Domain for life
  • Hack-free Protection
  • Fast SSD Storage
  • Free Drupal Transfer
  • Free CloudFlare CDN
  • Immediate Activation
View More

45 day money back
no contract