Jump to content


Photo

[Answered] How to force HTTPS throughout my website?

ssl certificate https

  • Please log in to reply
10 replies to this topic

#1 roguitar

roguitar

    Rank II Member

  • Members
  • PipPip
  • 77 posts

Posted 28 June 2019 - 02:16 AM

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.helione...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!

 



#2 sohamb03

sohamb03

    Rank VIII Member

  • Members
  • PipPipPipPipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 28 June 2019 - 04:01 AM

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]

Sayan Bhattacharyya


#3 roguitar

roguitar

    Rank II Member

  • Members
  • PipPip
  • 77 posts

Posted 28 June 2019 - 12:29 PM

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?



#4 flazepe

flazepe

    Rank X Member

  • Moderators
  • 1,057 posts
  • Gender:Male

Posted 28 June 2019 - 12:35 PM

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.



#5 sohamb03

sohamb03

    Rank VIII Member

  • Members
  • PipPipPipPipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 28 June 2019 - 01:04 PM

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.

Sayan Bhattacharyya


#6 roguitar

roguitar

    Rank II Member

  • Members
  • PipPip
  • 77 posts

Posted 28 June 2019 - 01:18 PM

 

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, 28 June 2019 - 01:21 PM.


#7 roguitar

roguitar

    Rank II Member

  • Members
  • PipPip
  • 77 posts

Posted 28 June 2019 - 01:26 PM

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?



#8 roguitar

roguitar

    Rank II Member

  • Members
  • PipPip
  • 77 posts

Posted 28 June 2019 - 01:34 PM

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, 30 June 2019 - 06:24 PM.
fixed quotes


#9 Luigi123

Luigi123

    Rank X Member

  • Moderators
  • 1,890 posts
  • Gender:Male
  • Location:Winnipeg, Manitoba, Canada

Posted 28 June 2019 - 01:37 PM

So did it work out?
Posted ImagePosted ImagePosted Image
Posted ImagePosted ImagePosted Image

#10 flazepe

flazepe

    Rank X Member

  • Moderators
  • 1,057 posts
  • Gender:Male

Posted 28 June 2019 - 01:57 PM

Yes.

#11 sohamb03

sohamb03

    Rank VIII Member

  • Members
  • PipPipPipPipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 28 June 2019 - 04:02 PM

Glad to help. 😊

Sayan Bhattacharyya






Also tagged with one or more of these keywords: ssl, certificate, https

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users