Setting Up Drupal to Use SSL

Use this page for setting up drupal to use ssl. Confirm the certificate is available first, then update the application or DNS settings that control HTTPS behavior.

TL;DR

Confirm the certificate works, enable cPanel Force HTTPS Redirect, then use Drupal admin or file edits only if the site still needs application-level cleanup. Clear Drupal caches and test the site afterward.

Before You Start

Need help?

If you are not comfortable editing Drupal files, contact Fused before making changes.

Option 1: Use cPanel Force HTTPS Redirect

Start here before editing Drupal files directly.

  1. Sign in to the Fused client area.
  2. Select Services.
  3. Select the green Active status next to the relevant hosting account.
  4. Select Login to cPanel.
  5. Open Domains.
  6. Turn on Force HTTPS Redirect for the Drupal domain.
  7. Visit http://example.com and confirm it redirects to https://example.com.

Option 2: Use Drupal Admin

Drupal core does not provide the same universal SSL switch in every version. Some sites expose HTTPS controls through installed modules, distribution settings, or hosting integration.

  1. Sign in to Drupal over HTTPS at https://example.com/user/login.
  2. Go to Configuration.
  3. Check for SSL, HTTPS, redirect, base URL, or security settings added by installed modules.
  4. If a setting exists to force HTTPS, enable it and save the configuration.
  5. Clear Drupal's caches from the admin interface.
  6. Test the public site and admin area in a private browser window.

If there is no HTTPS setting

That is normal for many Drupal installs. Use cPanel's Force HTTPS Redirect or the file-based method below.

Option 3: Edit Drupal Files

Use this path when cPanel and the admin interfaces do not expose the setting you need.

Drupal 7

  1. Open sites/default/settings.php.
  2. Look for a $base_url setting.
  3. If $base_url is set to an http:// address, update it to https://.
$base_url = 'https://example.com';
  1. Save the file.
  2. Clear Drupal's caches.
  3. Visit the site over https:// and click through a few pages to confirm links, images, and stylesheets load correctly.

If $base_url is not set

Many Drupal 7 sites do not need $base_url defined. If it is commented out or missing, do not add it unless the site specifically requires it.

Drupal 8, 9, and 10

Drupal 8 and newer usually detect the current request scheme, so most sites do not need a base URL setting changed in settings.php.

  1. Confirm https://example.com loads correctly.
  2. Add a server-level redirect from HTTP to HTTPS.
  3. Clear Drupal's caches.
  4. Test the public site and the Drupal admin area.

Force HTTP to HTTPS

If the site still loads over plain HTTP, add or confirm an HTTPS redirect. On many Drupal sites this can be done in the site's .htaccess file.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Place custom redirect rules carefully so they do not conflict with Drupal's existing rewrite rules.

Avoid redirect loops

If the site is behind a proxy, CDN, or load balancer, a simple HTTPS redirect may loop. Revert the change and contact Fused if the browser reports too many redirects.

Check for Mixed Content

After the site loads over HTTPS, check for images, scripts, stylesheets, or embeds still using http://.

What to Check