Knowledge Base

Forcing HTTPS on your website

Once your SSL certificate is active, send all visitors to the secure https:// version of your website. This protects your visitors and avoids "Not secure" warnings.

Check that your certificate works first by visiting https://yourdomain.com. See Free SSL certificates (Let's Encrypt).

Option 1: In DirectAdmin (recommended)

  1. Log in to DirectAdmin.
  2. Go to Account Manager and click Domain Setup.
  3. Click your domain.
  4. Tick Force SSL with https redirect and click Modify.

Option 2: With .htaccess

If you'd rather manage it yourself, add these lines near the top of the .htaccess file in your website's public_html folder:

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

Download a copy of .htaccess before you edit it.

WordPress websites

In your WordPress dashboard, go to Settings > General and make sure both WordPress Address (URL) and Site Address (URL) start with https://. You may be logged out after saving. Log back in at https://yourdomain.com/wp-admin.

If some pages still show "Not secure", see Fixing "Not secure" and mixed content warnings.

"Too many redirects" error

This usually means HTTPS is being forced in more than one place and the redirects are fighting each other. Use only one method. If you use Cloudflare, set its SSL/TLS mode to Full (strict), not Flexible.

Please rate this article to help us improve our Knowledge Base.

0 0