How do I force HTTPS?

21 views

How do I force HTTPS?

Overview

Forcing HTTPS ensures that all visitors automatically use the secure version of your website (https://). This improves security, builds trust, and is recommended for SEO.

Before You Start

Make sure:

  • An SSL certificate is already installed on your domain
  • Your website loads correctly using https://yourdomain.com

Method 1 – Force HTTPS using WordPress (Recommended)

  1. Log in to your WordPress dashboard

    • yourdomain.com/wp-admin
  2. Go to Settings → General

  3. Update both of these fields:

    • WordPress Address (URL): https://yourdomain.com
    • Site Address (URL): https://yourdomain.com
  4. Save changes

Method 2 – Force HTTPS using .htaccess (Advanced)

  1. Log in to DirectAdmin File Manager
  2. Open the public_html folder
  3. Edit the file named .htaccess
  4. Add the following code at the top:

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

  1. Save the file

Method 3 – Use a WordPress plugin (Easy option)

You can also install a plugin such as:

  • Really Simple SSL

Steps:

  1. Go to Plugins → Add New
  2. Search for the plugin
  3. Install and activate it
  4. Follow the setup wizard

Important Notes

  • Always install SSL before forcing HTTPS
  • Incorrect .htaccess changes can break your site
  • Clear browser cache after making changes
  • Mixed content (HTTP images/scripts) may still appear until fixed

Common Issues & Fixes

Website shows “Not Secure” after forcing HTTPS

  • Clear cache
  • Check SSL is properly installed
  • Fix mixed content warnings

Redirect loop error

  • Remove duplicate redirect rules in .htaccess
  • Disable conflicting plugins

Some pages still load HTTP

  • Update internal links in WordPress settings or database

Need Help?

If you need help enabling HTTPS or fixing mixed content issues, our support team can check your configuration and secure your website properly.

Top