×

How to redirect from HTTP to HTTPS?

HTTP (Hyper Text Transfer Protocol) is a protocol used for transmitting hypermedia documents, such as HTML files. This protocol is intended for communication between web browsers and web servers, but it can certainly be used for other purposes, such as communication between two devices or programmatic access to APIs.

HTTPS (Hyper Text Transfer Protocol Secure) represents the secured HTTP protocol, which transmits data in encrypted format, using SSL/TLS encryption, thus protecting user information.

Why is this redirection done?
Transitioning from HTTP to HTTPS is an essential step in website development because it significantly improves website security. Website visitors' data will be protected through encryption. Also, Google favors HTTPS sites in search results, which will lead to better SEO. Modern browsers mark HTTP sites as "dangerous," so by redirecting to HTTPS, visitors will have more trust.

Is anything needed to switch to HTTPS?
The only requirement to redirect from HTTP to HTTPS is to have a valid SSL certificate for the domain. If you don't know if your domain is protected by SSL, you can use an online tool to check: https://www.sslshopper.com/ssl-checker.html. If you don't have an SSL certificate, you can obtain one and then install it on your domain to secure it.

How do I set up the redirection?

  1. Connect to your server's cPanel account and access Domains -> Redirects.
    cPanel Redirects Button
  2. Fill in the fields of the "Add Redirect" section as follows:
    cPanel Add Redirect
    • Type: Permanent (301).
    • https?://(www.)?
      • Field 1: Select the domain you want to apply the redirection to.
      • Field 2: For this functionality, leave the field blank.
    • Redirects to: Enter the full site address with https in front: e.g., https://example.com
    • www. redirection: choose either Only redirect with www. or Redirect with or without www., depending on your preference.
    • Wild Card Redirect: Check this option if you want all pages of the site to be redirected to https.
  3. Confirm by clicking the Add button.

You can verify the redirection from http to https by accessing your site with http://example.com and, if you are automatically redirected to https://example.com, the redirection has been set up correctly. Remember to use your own domain; example.com is used as a reference example.