How to Force HTTPS Manually Using File Manager


Do not use host gator!!! – Signed up a year ago and tried to cancel about two months ago – I found it impossible to contact anyone and after emailing a manager asking to cancel he told me I couldn’t unless I sent them a copy of my passport (?) which I obliged in doing. Was then told they need a copy of my bank card (?) which I also provided and was then told this wasn’t sifficient evidence of identity and therefore my account cannot be cancelled. Then tried to cancel by formally emailing the manager saying the company did not have my permission to take any money from my bank account and that I would like my account to be closed – to which I was sent an extremely rude email from a manager saying they would not take my email seriously?!? Since this money has been taken from my bank account THREE TIMES in the past two months without my permission and without any success in closing my account with #hostgator. Anyone planning on using this site – BEWARE. I’vNever had a worse experience using any online service. M., Montreal


Simple steps on how to Install SSL and route all traffic to your site through HTTPS manually, through the .htaccess file. You can do this in “File Manager” on the HostGator Customer Portal. Sound intimidating? Don’t worry, we gotchu.

In This Video You’ll Learn:
How to Test To Make Sure Your SSL is Enabled
How to Manually Install SSL Through File Manager
How to Access the .htaccess File
How to Edit the .htaccess File

Here’s the code to use in your .htaccess file:

# Always use https for secure connections
# Replace ‘www.example.com’ with your domain name
# (as it appears on your SSL certificate)
RewriteEngine On
RewriteCond %SERVER_PORT 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

What is an SSL Certificate? – http://gtr.bz/TwNA30qC89v
How Do I Use My SSL Certificate? – http://gtr.bz/ZuVy30qC89m
Join our Website Owners Community on Facebook: http://gtr.bz/vYJZ30qIcfg

HostGator

27 Comments
  • PHP
    Posted at 18:09h, 07 May

    Hi, josh your tutorials are amazing!

    can you make a video on how to troubleshoot your database? your article is very hard to understand.

    https://www.hostgator.com/help/article/troubleshooting-mysql-database-connection-issues

  • SmartKid26
    Posted at 21:30h, 11 May

    Thanks Josh. I tried adding this into a site that I created using the free builder, but I'm getting 404 error (works fine if those lines are commented). Can you please advise how to resolve it.

  • boss na
    Posted at 15:26h, 01 June

    when I did this the site says Sorry, this page doesn't exist.

    Please check the URL or go back a page.

    404 Error. Page Not Found.

  • Y-Axis Aerial
    Posted at 22:02h, 18 June

    I also got the 404 error after doing these steps; the site tried to redirect to http://www.domain.com/public_html, I found on StackOverflow someone with the same issue. They added a "RewriteBase " line that seemed to do the trick. Here's the thread, the first answer to the question has that code: https://stackoverflow.com/questions/35695749/htaccess-force-ssl-redirecting-to-public-html

  • xapim1
    Posted at 19:51h, 04 July

    Well i tried everything from redirecting to https and i have on of my aliases domains that just wont redirect the domain to https dunno why its just weird (shared baby) UPDATE: nevermind if you dont redirect in the community board that your using in my case woltlab suite with the correct https:// in the admincp board options it wont redirect all fixed now well i was really dumb by not checking that in first place lol

  • checkout Film
    Posted at 23:02h, 20 July

    Tried doing this, did not work. The description does not contain the text either.

  • TEXAS BIGFISHING
    Posted at 14:10h, 11 August

    Hi josh I did exactly as you told and I managed to screw things up my site doesn't open up anymore in the file there was already some code in there I could send it into you if you would like to read it but I decided to revert back to what was in the file and it's still telling me the same thing and therefore my website is down at the moment.
    Thanks in advance for any help you may provide. cheers

  • Dahni Shaw
    Posted at 18:00h, 19 August

    Is there a problem with having my subdomains folder inside my public_html folder? Maybe it should be in the root /home folder? It seems like my subdomains .htaccess settings are inextricable from my main website which is a wordpress.

  • Anamarija Montak
    Posted at 08:15h, 08 September

    Josh! You are such a sweetheart! Second, I tried the code to redirect HSTS but no luck, do you have any tips?

  • Rosa R.
    Posted at 22:38h, 14 September
  • Summit Shakya
    Posted at 17:15h, 26 September

    Worked for me
    Thank you very much

  • felipe castillo
    Posted at 14:13h, 03 October

    RewriteEngine On

    RewriteCond %{HTTPS} !=on

    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  • Reyhan Yılmaz
    Posted at 19:07h, 07 January

    Thank you man. Very beneficial.

  • KitakuEigo
    Posted at 11:25h, 09 January

    Awesome. Thanks!

  • Daniel Ratner
    Posted at 02:18h, 20 January

    Great video! Easy and quick. Much appreciated!

  • Servant of Allah
    Posted at 15:10h, 27 January

    Thanks

  • K Bent
    Posted at 03:36h, 03 February

    Thank you. My site with Hostgator is now secured.

  • ThriftyAV
    Posted at 00:59h, 13 February

    Thank you! I love the fact that my website is now secure!… I'll be browsing for more tutorials as I continue to work on my Hostgator hosted site!

  • Dan McKenrick
    Posted at 00:47h, 27 February

    As someone who has ZERO knowledge of how to integrate an SSL certificate into my SIMPLE ONE PAGE HTML web site I could not find the basic info needed. Finally after many hours I stumbled upon your video and it open up a path toward successful integration. I kept looking for a way to modify my HTML script to interact with the SSL Certificate. Thanks again for the video. FYI I had to stop it multiple time and review your presentation as the information was delivered too fast for this Senior Citizen.

  • Nirzar Patel
    Posted at 07:31h, 28 February

    Works fine in February, 2021!! Thanks!

  • Chantel
    Posted at 19:48h, 02 March

    Josh. You absolute wizard. You've done it again. Thank you.

  • RockLegendBR
    Posted at 02:45h, 05 April

    great. it worked. thank you very much!!

  • ai pdp
    Posted at 13:30h, 03 May

    thank you sorry help me i did on my website it sends me back to a 404 page but goes to htpps

  • Diego Francisco
    Posted at 04:06h, 19 May

    Thank you, its worked for me in a Laravel Project

  • Spencer Sv
    Posted at 23:43h, 29 May

    Muchas gracias! Muy bien explicado

  • cute agrawal
    Posted at 13:11h, 03 June

    thanks

  • Craig Marcio Freese Passos
    Posted at 18:02h, 16 June

    great help. thanks a lot