• Go To Website
  • Go To Website
home/Knowledge Base/cPanel/How to redirect HTTP traffic to HTTPS using an htaccess file
Popular Search:Reseller Hosting, VPS Hosting, Professional Mail

How to redirect HTTP traffic to HTTPS using an htaccess file

Updated on August 15, 2024

1 – Login to your cPanel

2 – Navigate to File Manager

3 – Click on Settings button

4 – Tick “Show Hidden Files (dotline)” box and press Save button

5 – Navigate to the .htaccess file you want to edit, right click, and press edit

The below code when added to an htaccess file will automatically redirect any traffic destined for http: to https:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Was this helpful?

Yes  No
Related Articles
  • Generating Wildcard CSR
  • Using NodeJS Apps
  • How To Setup Node.js App in cPanel
  • How to change cPanel password from your Client Area
  • How to Restore backup using JetBackup5
  • How To Clone A Website In cPanel
Leave A Comment

You must be logged in to post a comment.

cPanel
  • How to redirect HTTP traffic to HTTPS using an htaccess file
  • Generating Wildcard CSR
  • Using NodeJS Apps
  • How To Setup Node.js App in cPanel
  • How to change cPanel password from your Client Area
  • How to Restore backup using JetBackup5
View All 93  
Popular Articles
  • How to install FREE SSL on cPanel
  • How to Install WordPress Online Using Softaculous App Installer
  • Listed Hosting Nameservers
  • How to register a domain, transfer a domain and buy Hosting Plan
  • Enable or Disable PHP’s GD Extension in cPanel
Categories
  • Affliates
  • Dedicated Servers
  • Billings & Payments
  • DNS
  • Files & Access
  • Cloudflare
  • cPanel
    • Softaculous
  • Backup
  • Node.js
  • General
  • Domain Reseller
  • Databases
  • WordPress
  • Email
  • Domain
    • Transfer
  • SSD Hosting
  • Nameservers
  • Cloud VPS
  • PHP
  • Migration
  • Resellers
    • WHMCS
    • WHM
  • Security
    • SSL
  • Professional Business Mail

  How to Restore backup using JetBackup5

How to read status information on your account  

  • © 2020 - 2024. Listed Hosting. All Rights Reserved.

Popular Search:Reseller Hosting, VPS Hosting, Professional Mail