Automatically Redirect Your Website's HTTP Traffic To HTTPS – cPanel

Run from this company as fast as you can – I moved my WordPress sites from GoDaddy to #hostgator a while back as I was fed up with GoDaddy, at first they seemed OK but anytime I would run into a problem which was usually on their end their support just plain sucks. Saying it sucks is putting it mildly, they are just plain idiots, I’m a power web user and there support staff seem as knowledgable as a box of rocks’ that is if you cen get them on the phone. After numerous issues with server reliabilty I’m fed up and am moving my sites elsewhere. Bruce Carter, OC, CA,

– How To Automatically Redirect Your Website’s HTTP Traffic To HTTPS
– Redirect HTTP to HTTPS automatically
– How to force HTTPS using the .htaccess file

Copy and paste following code in your .htaccess file:
RewriteEngine On
RewriteCond %HTTPS off
RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301]

“Once you have purchased and installed an SSL certificate, you can configure your server to automatically redirect visitors to the secure version of your website. This ensures data sent to and from your website is securely encrypted.” – HostPapa

“If you have a secure certificate (SSL) on your website, you can automatically redirect visitors to the secured (HTTPS) version of your website to make sure their information is protected.” – GoDaddy

HostPapa Help:
GoDaddy Help:

All rights reserved by Kingsley Media Productions™ – and/or any affiliates, content owner, creator etc.!

Intro Design Template by – Light’s Arts Production
Intro Design Customised by – Kingsley Chimezie

by – Kingsley Chimezie

[Description last updated: 30/07/2017]

Kingsley’s Tech Channel

  • Kingsley's Tech Channel
    Posted at 01:39h, 30 July

    Automatically redirecting HTTP traffic to HTTPS depends on the type of hosting you have. The code demonstrated in the video is Linus/cPanel servers.

    Posted at 19:40h, 08 December


  • shawn jacobsen
    Posted at 03:05h, 13 December

    btw, if it doesn't seem to be working right away make sure to clear your cache or use a different computer

  • The Engineer
    Posted at 20:44h, 20 December

    Kingsley, you are awesome. I Totally forgot how to do this. Thank you for the wonderful refresher course. Have a Merry Christmas.

  • Motivated Stories
    Posted at 00:58h, 21 December

    Thanks a lot man, It worked!

  • mwinyi abdallah
    Posted at 18:02h, 29 December

    thank you it worked

  • احمد خطاب Ahmed Khatab
    Posted at 12:02h, 13 January

    i havr index.php no index.html

  • احمد خطاب Ahmed Khatab
    Posted at 13:20h, 13 January

    i cant find index.html

    Posted at 22:42h, 22 January

    After seeing more than 10 videos that only said the same thing, only in this channel did I find the exact solution that I was looking for. CONGRATULATIONS. You do a great job. This is a great channel.

  • Pawan Mehroke
    Posted at 21:28h, 01 February

    it's work for me. thank you very much. could you please help me out how to add categorey in the urls. i want to this pattern in joomla 3.9 version.

  • shawn Maverton
    Posted at 01:01h, 04 February

    I know this video is 2 years old I followed the instruction paste the code in the .htaccess file but my site isn't redirecting to https

  • Melanin Moors
    Posted at 20:59h, 12 February

    The website is partial secured and pixels are not. What do I do? The website is disarrayed . I

  • Stephen Thompson
    Posted at 15:40h, 15 February

    I typically don't comment on videos but dude thank you so much! This absolutely fixed my issue. GoDaddy wanted to charge me extra to a package where they would do it which would be an extra $150.00 a year or something crazy. You saved me a bunch of money, thanks again!

  • juliano cypriano garcia
    Posted at 18:29h, 17 February


  • Benazir B
    Posted at 05:39h, 21 February

    Thank u so much….it worked correctly..

  • shawn Maverton
    Posted at 06:36h, 24 February

    Great video but what if you already have an existing .htaccess file that have code already where do you put the redirect? I crash my whole site even the cpanel by placing the code.

  • Kyosh Master
    Posted at 10:50h, 28 February

    thanks for this tutorial, i need this to help the company to secure their website! kudos bruh!

  • kalim M
    Posted at 17:18h, 04 April

    Can we use . htaccess with nginx?

  • OuTPosT
    Posted at 19:43h, 23 April


  • thrudaface
    Posted at 22:49h, 18 May

    hell yah dude! that worked! would have been easier if you just said to put the .htaccess file in your root directory and add the code. I mean the directory of your website index.

  • thrudaface
    Posted at 22:52h, 18 May

    dude it even worked in my forums folder with the index.php so basically you want to put it into any folder with an index page or any page I think

  • Pk hindigyanbook
    Posted at 08:37h, 27 May


  • Weeby
    Posted at 00:48h, 29 May

    Your fucking amazing dude much love <3

  • Andres Revollo
    Posted at 14:38h, 30 May

    excellent video bro, keep up the good work….

  • buyindemand
    Posted at 06:46h, 03 June

    Thanks Man

  • Brooks Agnew
    Posted at 17:11h, 10 June

    What is the code?

  • Saqib Talib
    Posted at 13:18h, 13 June

    thank you so much. You solve my issue. Great man.

  • Yeasir Arafat
    Posted at 15:45h, 17 June

    Thank You. This is my first comment on Youtube, Though i am using it since 2014. i have seen lot of tutorials but this is first time i have commented. because you are awesome man…!!

  • Yohan jose Ysturiz Diaz
    Posted at 15:47h, 28 June

    Sos un Crack!, thank You!.

  • Moman Jutt
    Posted at 15:18h, 29 June

    This only works in chrome browser for pc.
    In other browsers in pc it doesnot work or even on phones !!!

  • Moman Jutt
    Posted at 15:19h, 29 June

    Another solution ?

  • sthembiso makhushe
    Posted at 09:48h, 02 July

    hi i need help on how to remove a message which pops up when i try to go my domain name and it says "index of and it gives me the panel which appears on cpanel where i need to click my aploaded file before it can take me to my website instead of taking me straight to my website

    Posted at 16:29h, 03 July


    I have activated SSL without any problems but when uploading the HTML template to the hosting site and logging in to the template is a mock-up, and if I'm logged in without HTTPS, I will work without any problems.

    Can you guide me?

  • Anze Sustar
    Posted at 16:18h, 08 July

    Thank you very much, explained in simplest possible mode. Keep on doing well.

  • Prasad Dhumal
    Posted at 16:40h, 11 July

    Thanks BRUH

  • Avijit Ghosh
    Posted at 15:53h, 13 July

    Thanks Brooo. Its working…