Drupal: How to enable HTTPS support in Drupal

In order to enable https on Drupal site, you need to implement following .htaccess snippet. Obviously, I assume that you have access to the Server SSH/FileManager or FTP and SSL is installed & configured for your site already on the server.

From .htaccess of your site root folder uncomment the following:

#1
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Then to redirect all http:// to https:// implement following snippet in .htaccess file.

# 2 Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

That’s all you nee to do, and you are good to go.

Author: Danyal
I'm working as programmer since 2002. Born, grew up, studied and worked in Pakistan now Im located in Denmark since 2006.