Forcing HTTPS via .htaccess

SSL & Security Updated Jan 15, 2026

Redirect HTTP to HTTPS

After SSL is installed, redirect all traffic to the secure version.

Method 1: cPanel (Easiest)

  1. Log in to cPanel
  2. Go to Domains
  3. Find your domain in the list
  4. Toggle Force HTTPS Redirect ON

Method 2: .htaccess

  1. Go to cPanel → File Manager
  2. Navigate to public_html
  3. Show hidden files (Settings → Show Hidden Files)
  4. Edit .htaccess
  5. Add at the top:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Method 3: WordPress

  1. Go to Settings → General
  2. Change WordPress Address (URL) to https://
  3. Change Site Address (URL) to https://
  4. Save Changes

Fix Mixed Content

If you see "Not Secure" despite HTTPS:

Test: Visit http://yourdomain.com - it should redirect to https://

Was this article helpful?