roguitar Posted June 28, 2019 Posted June 28, 2019 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_CertificateOk, 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! Quote
Sn1F3rt Posted June 28, 2019 Posted June 28, 2019 Add the following code to your .htaccess file (create new if u don't have one) : RewriteEngine OnRewriteCond %{HTTPS} !=onRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Quote
roguitar Posted June 28, 2019 Author Posted June 28, 2019 Add the following code to your .htaccess file (create new if u don't have one) : RewriteEngine OnRewriteCond %{HTTPS} !=onRewriteRule ^ 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? Quote
Flaze Posted June 28, 2019 Posted June 28, 2019 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. Quote
Sn1F3rt Posted June 28, 2019 Posted June 28, 2019 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. Quote
roguitar Posted June 28, 2019 Author Posted June 28, 2019 (edited) 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 June 28, 2019 by roguitar Quote
roguitar Posted June 28, 2019 Author Posted June 28, 2019 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? Quote
roguitar Posted June 28, 2019 Author Posted June 28, 2019 (edited) 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! 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 June 30, 2019 by Krydos fixed quotes Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.