More than millions of websites, including small & large websites, make use of the powerful content management system (CMS) named Drupal. It’s a scalable and super-fast open-source platform used by many high-profile websites like the Australian Government, NBC, and the White House for online delivery and management of content. Similarly, securing the website is equally important. Installing an SSL certificate is the first and most crucial step to prevent error messages or site load failures.
This article will give you the steps of installing an SSL certificate on Drupal and what prerequisites you need to take care of.
What Are the Prerequisites to Secure Drupal with SSL?
Before you begin SSL setup for Drupal website, make sure you have a server certificate, intermediate certificate, and private Key in place.
In case you don’t know how to get this server certificate, intermediate certificate, and private Key, read below:
-
Server Certificate
It’s the certificate you get from a certificate authority such as Sectigo, Comodo or DigiCert for your domain. You might have received it through an email. However, you can also download it from the Account Dashboard of your SSL Certificate provider by clicking on the order.
-
Intermediate Certificate
These are the files that let your devices connect to the server and identify the CA that issued the SSL/TLS certificate. You may receive more than one of such certificates, for instance, a Zip folder. If that’s the case, then it may contain the intermediate certificate, which is also called a CA Bundles. If you haven’t, you’ll be required to download the correct CA Bundle for your SSL certificate.
-
Private Key
Private Key is the file that could be on your server or with you if you’ve generated the CSR. Similarly, on some platforms like Microsoft IIS, the private Key is not likely visible to everyone, but the server has a track of it.
Before you get these three certificates, you’ll need to generate a CSR for your website. Here, CSR is a certificate signing request, which is one of the initial steps toward getting or installing SSL certificate on Drupal-based or any website. It’s an encoded text block that includes details of your company and website identity, which is verified by the certificate authority before issuing you the purchased SSL certificate.
It’s important to know the information you give within the CSR must be correct and latest, or there’s a possibility that the CA (Certificate Authority) may reject your CSR (Certificate Signing Request).
- Main certificate, which is of .crt extension.
- Root & Intermediate Certificate (.ca-bundle file)
- Private Key certificate
Here’s the Steps to Install SSL Certificate on Drupal
Follow the below steps and install your SSL certificate on Drupal.
- Using SSH, log into the account.
- In the Drupal Directory, open the .htaccess file. (You can make use of the command-line text editor for this step.)
-
Within the .htaccess file, copy and paste the below-mentioned code:
RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
- Save the .htaccess file.
Steps to Test the Installed SSL Certificate on Drupal
Now, by the below steps, let’s test the status of the SSL setup for Drupal website.
- Close the File Manager.
- Log out from your hosting provider’s cPanel.
- Login into your admin page of Drupal.
- Go to the Select Site > Global Configuration > System from the admin toolbar.
- Locate the option “use Apache mod rewrite” and click Yes on it.
- Click on the Save button.
- Now, in the web browser, open the Drupal website.
If everything is successful, below mentioned event should occur:
For instance, if you type www.drupal-website-example.com or drupal-website-example.com, it’ll be redirected to https://www.drupal-website-example.com.
Conclusion
We hope this article clears doubts regarding how to install SSL certificate on Drupal. In addition, make sure that you test or check your SSL installation status. To verify whether SSL setup for Drupal website is successful or not, you can make use of SSL testing tools like SSL Checker, as it provides instant detailed reports, including identification of any error or vulnerability if it’s present.