• 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 April 8, 2022

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
  • How to Install WordPress Online Using Softaculous App Installer
  • Enable or Disable PHP’s GD Extension in cPanel
  • Creating MySQL Users and Databases
  • Listed Hosting Nameservers
  • What is an index page?
  • Website staging with Softaculous
Leave A Comment Cancel reply

cPanel
  • How to redirect HTTP traffic to HTTPS using an htaccess file
  • How to Install WordPress Online Using Softaculous App Installer
  • Enable or Disable PHP’s GD Extension in cPanel
  • Creating MySQL Users and Databases
  • Listed Hosting Nameservers
  • What is an index page?
View All 74  
Popular Articles
  • How to Install WordPress Online Using Softaculous App Installer
  • How do I set up my domain’s personal Nameservers?
  • How do I use a browser to dynamically update the host’s IP?
  • What does “Awaiting release from previous registrar” transfer status mean?
  • How to Preview Your Website on Our Servers
Categories
  • SSD Hosting
  • Cloud VPS
  • Migration
  • Resellers
  • Security
    • SSL
  • Databases
  • Affliates
  • WordPress
  • Billings & Payments
  • Email
  • Files & Access
  • PHP
  • Nameservers
  • cPanel
    • Softaculous
  • Professional Business Mail
  • Backup
  • General
  • Domain
    • Transfer

  How to set up email forwarding in cPanel

How to read status information on your account  

  • © 2022. Listed Hosting. All Rights Reserved.

Popular Search:Reseller Hosting, VPS Hosting, Professional Mail