Redirect HTTP to HTTPS cPanel

There are a couple of ways to ensure that all non-secure connections  (HTTP) are forced to use a secure connection (HTTPS). The simplest of which is to go the root directory of your cPanel / hosting platform (normally www or public_html) and create a file .htaccess. Note the . in front of htaccess. Paste the following in this file:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^YOUR-DOMAIN.co.za$ [OR]
RewriteCond %{HTTP_HOST} ^www.YOUR-DOMAIN.co.za$
RewriteRule ^(.*)$ https://YOUR-DOMAIN.co.za/$1 [R,L]

This will ensure that your-domain.co.za as well as www.your-domain.co.za are both redirected to https://your-domain.co.za.