How to redirect HTTP to HTTPS
- Log in to your cPanel.
- Go to File Manager > public_html.
- Edit the .htaccess (it may be hidden - go to Settings and enable "Show Hidden Files").
- 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>