Overview
In this article we will show you how to Redirect HTTP to HTTPS in cPanel, if you have an SSL certificate on your website, you can automatically forward visitors to the secure version (HTTPS) of your site for a secure connection. There is a simple tool in the panel that will help you achieve this, we'll explain it in this lesson.
Enforcing SSL for the main domain
In this article we will show you now how to redirect HTTP to HTTPS in the primary domain cPanel:
- Log in to your cPanel account.
- From the Domains menu, click Domains
- This will open a page where you can toggle the HTTPS redirect on or off.
- Ensure that you have installed SSL and the option to Run appears.
- Your domain name is now running with an SSL certificate.
redirects visitors to the HTTPS version of your site
Linux uses .htaccess files to handle redirection. You may need to create a .htaccess file, and you can use your control panel's File Manager. Using the following code in your .htaccess file automatically redirects visitors to the HTTPS version of your site:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]