If you’ve recently purchased a domain and noticed that visiting your site with “yourdomain.com” or “http://yourdomain.com” shows it as “Not Secure,” but using “https://yourdomain.com” is secure.
 
It means your site isn’t automatically redirecting HTTP traffic to HTTPS. This guide will walk you through the steps to fix this in your cPanel.
 
Step 1: Enable HTTPS Redirection via .htaccess
 
1. Log in to your cPanel account.
 
2. Go to the “File Manager.”
  • You can find this under the “Files” section on your cPanel dashboard.
3. Locate the .htaccess file in your website’s root directory.
  • This is usually found in the public_html folder.
  • If you don’t see a .htaccess file, you may need to create one. Right-click in the public_html folder and select “New File,” then name it .htaccess.
4. Edit the .htaccess file.
  • Right-click the file and select “Edit.”
  • Add the following lines of code to the file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • Save your changes.
 
This code tells the server to redirect all HTTP requests to HTTPS, ensuring all traffic to your site is secure.
 
 
Step 2: Use cPanel’s Force HTTPS Redirect Feature
 
1. Log in to your cPanel account.
 
2. Navigate to the “Domains” section.
  • This can be found in the “Domains” section of the cPanel dashboard.
3. Find your domain in the list and toggle the “Force HTTPS Redirect” option.
  • This option may be labeled slightly differently depending on your cPanel version, but it will be something similar to “Force HTTPS Redirect.”
 
Conclusion
 
By following these steps, you ensure that all visitors to your website are automatically redirected to the secure HTTPS version. This not only improves your site’s security but also builds trust with your visitors.
 
If you have any questions or need further assistance, please feel free to contact us.
Was this answer helpful? 0 Users Found This Useful (0 Votes)