Redirect HTTP to HTTPS automatically

First, Install the free SSL (Let's Encrypt™ SSL). To install, log in to CPanel > Let's Encrypt™ SSL > Issue > Issue.

Linux uses .htaccess files to handle redirection.

You may need to create a .htaccess file at File Manager >  public_html.

Using the following code in your File Manager >  public_html > .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]

 

OR

 

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://yourdomainhere.com/$1 [R,L]

 

If you have an existing .htaccess file:
Do not duplicate RewriteEngine On.
Make sure the lines beginning RewriteCond and RewriteRule immediately follow the already-existing RewriteEngine On.

  • Redirect HTTP to HTTPS automatically, Redirect HTTP to HTTPS automatically
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

CPanel Demo

CPanel Webhosting Demo: http://demo.gomanilahost.net:2082 username: democpanelpassword:...

How to Change your Default Timezone in htaccess

1. Login to CPanel. 2. Click to File Manager (select Show Hidden Files) 3. Click to public_html....

Logging in to cPanel

Logging in to the cPanel control panel is very simple.  In your web browser's URL bar, type...

Logging in to cPanel using WinsCP

Download and install WinsCP: http://winscp.net/eng/download.phpKEYBOARD SHORTCUT:F4 - To open...

What domain name extension should I get?

Generally, both individuals and enterprises are free to choose which domain extension they want...