How to redirect HTTP to HTTPS

  1. Log in to your cPanel.
  2. Go to File Manager > public_html.
  3. Edit the .htaccess (it may be hidden - go to Settings and enable "Show Hidden Files").
  4. Amend the following code with your domain name:
<VirtualHost *:80>
	ServerName www.example.com
	Redirect / https://www.example.com/
</VirtualHost>
<VirtualHost *:443>
	ServerName www.example.com
	# ... SSL configuration goes here
</VirtualHost>