After purchasing and installing an SSL certificate, you should automatically redirect visitors to a secure version of your website ( https:// ).

This ensures that data sent to and from your site is securely encrypted. In addition, according to Google, HTTPS is now a ranking signal among several other factors.

What is HTTPS, and why should you use it?

HTTPS, displayed as a padlock icon in the web browser bar, indicates the use of SSL to transfer data between a web server and a website. Any website, especially one that requires you to enter credentials and sensitive data, must use HTTPS.

How does HTTPS redirection work?

Let’s say you’ve just installed SSL on your website, whether it’s through our Let’s Encrypt one-click installer or purchased through your customer account.

The forced HTTPS redirect feature in cPanel allows you to automatically redirect visitors to a secure version of your site.

How to force HTTP to HTTPS redirection in cPanel?

1.Log in to cPanel.

cPanel-Domains-hostkoss

2.Once in the cPanel control panel, scroll down to the Domains section and click on the Domains icon.

The domains interface will then appear, where you will see a list of all the domains on your cPanel account. You will see a column labeled “Force HTTPS Redirect“.

cPanel-Domains-Forced-redirection-to-HTTPS-Actions

3.Find the domain that you want to redirect to HTTPS and set the corresponding Forced HTTPS Redirection setting to on, as in our example:

You can toggle multiple domains to enable or disable forced HTTPS redirection using the option at the top of the table. Check the box for each domain and select whether you want to enable or disable them all.

4. Now let’s go back and visit your site. Notice how it redirects us to the secure version and we see the secure lock symbol in the location bar.

How to manually redirect HTTP requests to HTTPS using .htaccess

However, if for some reason your site does not work after you have enabled forced redirection in cPanel, try doing so via a .htaccess file.

1.Edit/create a .htaccess file in the folder your site is served from (usually public_html). You can easily edit the .htaccess file using an FTP client or through the online file manager in cPanel.

cPanel-Domains-htaccess

2. Add the following code to the .htaccess file:

  • RewriteEngine On
  • RewriteCond %{HTTPS}  !=on
  • RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

3.Save the file and check the results in your web browser by trying to access your site using standard HTTP rather than HTTPS.

If everything works correctly, you should be automatically redirected to https.

Please note: If you do not have an SSL certificate installed, this may cause errors. Please make sure you have an SSL certificate installed and working before proceeding with this procedure.

Read also:

FAQs

Is HTTPS redirection necessary for all websites?

HTTPS redirection is highly recommended for all websites, especially those that handle sensitive information such as login credentials or payment details. It enhances security and boosts SEO performance.

What are the potential drawbacks of HTTPS redirection?

While HTTPS redirection offers numerous benefits, it can sometimes cause compatibility issues with older web browsers or outdated plugins. It’s essential to test your website thoroughly after implementing HTTPS redirection to ensure compatibility.

Can I implement HTTPS redirection on my own, or do I need assistance?

While technically savvy users may be able to implement HTTPS redirection themselves, it’s recommended to seek assistance from web development professionals, especially for complex websites or e-commerce platforms.

How long does it take for HTTPS redirection to take effect?

HTTPS redirection typically takes effect immediately after configuration. However, it may take some time for search engines to recognize the change and update their indexes accordingly.

Does HTTPS redirection impact website performance?

In most cases, HTTPS redirection has minimal impact on website performance. However, poorly optimized HTTPS configurations or mixed content issues can result in slower page load times.

Is HTTPS redirection compatible with all hosting providers?

HTTPS redirection is supported by most modern hosting providers, including cPanel-based hosting platforms. However, it’s essential to verify compatibility and ensure that your hosting plan includes SSL certificate support.

About the Author

Andrii Kostashchuk

Andrii has experience in programming in various languages for different platforms and systems. He has spent more than 8 years in the Internet sphere, working with various CMS, such as: Opencart, Drupal, Joomla, and of course, the most popular content management system WordPress.

View All Articles