In my previous article, I have taught you how to add Let’s Encrypt Certificate to your PHP sites. In this article, I will teach you how to install Let’s Encrypt SSl certificate on Drupal sites and force them to use HTTPs only. All the requirements for Let’s Encrypt are the same as I have discussed in my previous article.
Now let’s start.
How to Install Let’s Encrypt SSL Certificate on Drupal
First, log in to your Cloudways account and navigate to the application where you wish to install Let’s Encrypt. In your Drupal application management menu, click on SSL Certificate in the left side menu to utilize Cloudways’ free SSL hosting for easy and secure installation.
Now in the Let’s Encrypt fill with your email and domain for which you are going to add SSL and click on Install Certificate. You also have to option to add the SSL certificate for multiple domains.
Wait for Cloudways to install Let’s Encrypt SSL on your site.
Once it’s installed, select YES from the Auto Renewal drop down and then click on Save Changes to let Cloudways renew your certificate automatically.
Now point to your domain like https://www.example.com. You will see that your CSS is not loading properly. In order to load it properly, go the Master Credentials tab on your server and Launch the SSH terminal.
Sign in with your credentials and type the following command to reach the Drupal settings.php folder.
cd applications/<your application name>/public_html/sites/default
Now type the following command to edit settings.php
vi settings.php
Now press down key till you find this line
$base_url = 'http://yoursiteurl';
Now press Insert key and comment that line.
Now press ESC and :wq to save and exit the editor. Now again open your site using https and you will see that your theme is fully loaded now.
Stop Wasting Time on Servers
Cloudways handle server management for you so you can focus on creating great apps and keeping your clients happy.
Ease and Convenience
You have successfully configured your Drupal site for SSL use.
I hope you found this article helpful. If you’ve got any questions, leave them in the comments section below.
Cloudways Managed Drupal Hosting Platform is built to make life easy for developers and agencies. Server and application management are easy and security is a prime feature of the Cloudways Platform. Sign up for your free trial today.
Ahmed Khan
Ahmed was a PHP community expert at Cloudways - A Managed PHP Hosting Cloud Platform. He is a software engineer with extensive knowledge in PHP and SEO. He loves watching Game of Thrones is his free time. Follow Ahmed on Twitter to stay updated with his works.