buyer location

Arsal from Location just purchased the Starter Plan

Visit Starter Plan

How to redirect a website from HTTP to HTTPS in cPanel

AI Summary
SSL certificates are essential for website security and SEO, as Google flags non-HTTPS sites as unsafe. Hostcry includes free SSL with every hosting package, and you can easily redirect HTTP to HTTPS via cPanel’s "force HTTPS redirect" option or by editing the .htaccess file with a simple code snippet.


Secure socket layer (SSL) is very important for websites these days, hostcry offers free SSL on every package. If you browse your website on Google Chrome and you don’t have an SSL (not redirected to HTTPS), Google will show warnings that the website you are visiting is unsafe. And having an SSL certificate is also a ranking factor.

If you don’t have an SSL certificate installed on your domain, first you need to install an SSL certificate.

Now that you have an SSL certificate, but your users can visit both versions of your website using HTTP and HTTPS, you need to redirect users to HTTPS.

 

How to redirect from HTTP to HTTPS in cPanel:

  1. Log in to your cPanel.

 domain section in cpanel

  1. Search for the domains section.
  2. Click on domains in the domains section.
  3. This will open all of your domains on the right side of your desired domain. You will see the option to enable “force HTTPS redirect”. Just enable SSL.

 Enable HTTPS redirect

Now your website should be redirected to HTTPS.

 

How to redirect the website to HTTPS using an .htaccess file?.

 

  1. Open the file manager in your cPanel.
  2. Go to your website directory and look for the .htaccess file.
  3. If you can’t find the .htaccess file, it might be missing or hidden.
  4. First, show all hidden files.

 

How to show all Files in cPanel.

Click on Settings at the top right corner of your file manager screen.

Click on Show all hidden files and click Save.

 click on settings in file manager and show hidden files

  1. If you still can’t find it, you need to create a .htaccess file.

 

How to create an .htaccess file in cPanel.

Click on + File on the top left side of your file manager screen.

Enter .htaccess and click save.

 create new file in file manager

  1. Right-click and edit the file.

 edit file

 

  1. Enter the following code in your .htaccess file.


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

If you have an existing .htaccess file.

  • Do not duplicate RewriteEngine On.
  • Make sure RewriteCond and RewriteRule follow the already written RewriteEngine On.