How to Force SSL in Drupal

After purchasing & Installing the SSL certificate, you will need to force SSL usage on Drupal / WordPress.

Inside the .htaccess file, you will need to add something like this (replacing your domain name as needed):

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^domainname\.com*
RewriteRule ^(.*)$ https://www.domainname.com/$1 [L,R=301]

These rewrite conditions should be placed after the following lines:

<IfModule mod_rewrite.c >
RewriteEngine on

Author: Chathura Ariyadasa

A highly talented IT professional with extensive experience and capabilities in performing a variety of IT Security, Computer Networking and IT Help Desk duties and responsibilities in the IT Department.