My website is not working on http, but works only https, how do I redirect http to https

Short answer: your domain gets a free SSL certificate automatically. To make visitors always use https://, switch on Force HTTPS Redirect in cPanel, or add a short rule to your .htaccess file. In WordPress, also set both addresses to https://.

Check your certificate first

In cPanel open SSL/TLS Status. Your domain should show a valid certificate. If not, run AutoSSL and wait a few minutes.

The cPanel SSL/TLS Status page with green padlocks for valid certificatesSSL/TLS Status: a green padlock means the certificate is active.

Method 1: cPanel toggle (easiest)

  1. In cPanel open Domains.
  2. Find your domain and switch Force HTTPS Redirect on.
The cPanel Domains page with the Force HTTPS Redirect switchcPanel, Domains: the Force HTTPS Redirect switch is next to your domain.

Method 2: .htaccess rule

  1. In cPanel open File Manager. Click Settings (top right) and tick Show Hidden Files (dotfiles). Save.
  2. Open public_html. Edit the file .htaccess, or create it. The name starts with a dot.
  3. Add these lines at the top:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  1. Save. Type your address with http://. It should jump to https://.

If you use WordPress, keep the WordPress rules that are already in the file. Add the lines above the # BEGIN WordPress line.

WordPress: use https in your settings

Go to Settings, then General. Make both WordPress Address and Site Address start with https://. Save.

Problems

Redirect loop ("too many redirects")

This can happen if two redirects fight each other, for example a plugin and .htaccess, or a CDN set to a mode that talks to your server over http. Remove the extra redirect so only one is left.

Still "Not secure"

An image or script may still load over http://. Re-save the page, update old links to https://, and clear your cache.

Still stuck? Open a support ticket with your domain name and what you see. Please do not put passwords in the ticket.


Related tutorial

  • 0 Users Found This Useful
  • redirect http to https, redirect to ssl, https
Was this answer helpful?
Still stuck? Ask our AI assistant for help troubleshooting this.

Related Articles

How to sign up for AkolagTech hosting plan - Video

How to sign up for AkolagTech hosting plan?Video Tutorial on how to sign up for hosting plan

AkolagTech hosting platform login and navigation - Video

How to log-in and navigate to AkolagTech platform video tutorial 

AkolagTech Hosting Platform Tutorial (Web, Email, Cloud) info

How to log-in and navigate through the hosting platform  Access to your product and services...

HOW TO INSTALL SOFTWARE, PLUGINS, AND APPS ON YOUR AKOLAGTECH HOSTING ACCOUNT?

ABOUT THE HOSTING PLATFORM AkolagTech hosting platform for SME/SMB, developers (web developers,...

How to transfer domain from existing provider to AkolagTech

Short answer: Unlock the domain and get the EPP code at your current registrar, then enter the...