In cPanel, you can force the use of HTTPS by redirecting all HTTP traffic to HTTPS. Here are the steps to do this:
- Log in to your cPanel account.
- In the "Domains" section, click on "Redirects."
- Select "Permanent (301)" as the type of redirect.
- In the "Redirects to" field, enter the full HTTPS URL of your website (e.g. https://www.example.com).
- In the "Redirects from" field, enter the full HTTP URL of your website (e.g. http://www.example.com).
- Click on the "Add" button to save the redirect.
You can also use .htaccess to redirect http to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
It is advisable to test your website after making these changes to ensure that everything is working as expected.