Redirect HTTP to HTTPS (and avoid redirect chains)

Send every visitor to the secure version of your site with one clean 301 redirect.

Updated 10 November 20262 min read8 views0 found this helpful
Applies tocPanel logoLiteSpeed logo
On this page

Having a certificate isn't enough: visitors who type http:// or click old links must be sent to https://. Search engines also prefer one secure address.

In cPanel (easiest)

  1. Open Domains → Domains.
  2. Switch on Force HTTPS Redirect for your domain.
  3. Test by visiting http://yourdomain.co.ke — the address bar should change to https.

With .htaccess (Apache and LiteSpeed)

Add this at the top of the .htaccess file in public_html. It also sends www to the bare domain in the same hop:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://example.co.ke%{REQUEST_URI} [L,R=301]

Swap the target if you prefer www.example.co.ke as the main address.

On Nginx

server {
  listen 80;
  server_name example.co.ke www.example.co.ke;
  return 301 https://example.co.ke$request_uri;
}

WordPress

Under Settings → General, make sure both WordPress Address and Site Address start with https://. Then run a search-and-replace for old http:// links (see fixing mixed content).

Avoid redirect chains

A chain such as http://www → https://www → https:// → https:///home costs a round trip for every step and slows the first visit. Redirect straight to the final address in one 301, and update menu links, adverts and social profiles to the final URL.

#HTTPS#redirect#.htaccess#Nginx

Was this article helpful?

Your vote helps us write better guides.

Keep reading

Related articles

Still stuck?

Talk to our support team

Open a ticket

Best for anything technical. Every reply is tracked.

Submit a ticket

Call our Nairobi team

+254 726 872 512 · +254 722 917 455

Call now

Message us

Send a question and we'll reply by email or phone.

Contact support
Launch today

Powering Your Online Success!

Domain, hosting, email and SSL from one local team — set up in minutes and backed by people you can call.

  • Free SSL
  • Free migration
  • 99.9% uptime
  • 24/7 expert support

Start with your domain

Check availability, then add hosting in the same order.

Prefer to talk? Call +254 726 872 512