Redirect Website to https (Force HTTPS) (cPanel) Print

  • 337

If your website has an active SSL Certificate, it will work under the secure address of https:// (for example, https://alpha.net.bd). You may want to redirect all incoming requests to your website to always go to https (secure) rather than http (unsecure). This is also known as "Force SSL" or "Force HTTPS".

Some CMS's such as Wordpress already have an option to Force SSL in the backend section so the below only applies for other websites.

You can force an HTTPS connection on your website by adding these rules in your website's .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] 

The .htaccess file needs to be located inside the site's document root folder. If your website is in a sub folder, then the .htaccess should be placed in the corresponding sub folder.

You can create or edit the .htaccess file either via FTP, or using with the File Manager available in cPanel.


Was this answer helpful?

« Back