Jump to content

[Answered] How to force HTTPS throughout my website?


roguitar

Recommended Posts

Hi, there! Howdy, all? This time, my question is related to how I can force https only throughout my website. Well, I've installed my certificates via ZeroSSL, just by following the instructions given by you at: https://wiki.helionet.org/Installing_a_Let%27s_Encrypt_SSL_Certificate

Ok, excellent! It's all working. But even so, I notice that if I type http it still there. What I want is that when a user types http as if it were the default protocol and then presses "enter", he/she is automatically redirected to the https version. That's all, guys. So... How do I do this? Thank you!

 

Link to comment
Share on other sites

Add the following code to your .htaccess file (create new if u don't have one) :

 

RewriteEngine On

RewriteCond %{HTTPS} !=on

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

Alright, but... I believe that I don't have one. How do I create it? Do I just click on create new file and name it .htaccess and then add the code above given by you? Could you give me an example?

Link to comment
Share on other sites

Alright, but... I believe that I don't have one. How do I create it? Do I just click on create new file and name it .htaccess and then add the code above given by you? Could you give me an example?

Do as flazepe directed first. However if u still don't find that file then your method is correct.

Link to comment
Share on other sites

 

Alright, but... I believe that I don't have one. How do I create it? Do I just click on create new file and name it .htaccess and then add the code above given by you? Could you give me an example?

Do as flazepe directed first. However if u still don't find that file then your method is correct.

 

Oh, now I understood. I'll try here, then I'll let you know, guys! ;)

Edited by roguitar
Link to comment
Share on other sites

Go to the settings in the upper right of cPanel File Manager and enable the "show hidden files (dot files)" option. If you still don't see it, you can just create a new one.

Where do I create the file? In what folder?

Guys, I got it!  :)  <_<  :D  :D  :D  :D  :D  :lol:  You're awesome! Thank you!! I just created the .htaccess file copied and pasted the proposed code into it and in the root directory and bingo!

Edited by Krydos
fixed quotes
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...