It is always advised to use an SSL certificate with your domains and access it via HTTPS. By default, the browser access will be using HTTP protocol and we need to set up a redirection. There are multiple ways are available to configure the same. Basically, it works with a '.htaccess' file in the home directory, but we can add it using different ways. If you are good with the command line, you can directly add an htaccess file, if it is a WordPress website, you can use plugins and I am showing here about how to do it from cPanel. You can watch the video tutorial by clicking here.
- Login to the cPanel interface and choose the 'Redirects' option under the 'Domains' section.
- Select the 'Permanent(301)' option from the 1st box and then choose the domain you need to set the redirect.
- Next is to choose the folder. If you are looking to redirect the main domain, leave the next field blank. If you are looking to redirect a folder inside the home directory, give it there after the / provided there by default. In the following image, a redirection is set to https://testdomain/com/demo.
- Once it is added, you can see them at the bottom of the page and we can remove them if needed.