Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: Plantje - lokakuu 30, 2019, 09:33:05 AP

Otsikko: Default to https and SSL
Kirjoitti: Plantje - lokakuu 30, 2019, 09:33:05 AP
I got the request to install an SSL certificate. I contacted my host (one.com) and they said they could enable SSL on both of the websites I am running and so they did.

Do I need to do something else to have an SSL certificate? Or is this ok now?

Does an SSL certificate mean HTTPS access is possible? Or is that something completely different?

Now I added the following to the .htaccess of both sites:
#Rewrite everything to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

However, the redirect doesn't seem to work. Is something wrong with it?

I am running:
www.vliegvissers.nl/SMForum/index.php
www.vliegvissers.com/SMForum/index.php

If I go to https://www.vliegvissers.nl/SMForum/index.php it shows me parts of the website are not secure.


Otsikko: Re: Default to https and SSL
Kirjoitti: Illori - lokakuu 30, 2019, 09:36:32 AP
take a look at https://www.simplemachines.org/community/index.php?topic=555034.0 as a start.
Otsikko: Re: Default to https and SSL
Kirjoitti: Plantje - lokakuu 30, 2019, 09:43:29 AP
Thanks! Looks like a good start!
Otsikko: Re: Default to https and SSL
Kirjoitti: a10 - lokakuu 30, 2019, 10:00:03 AP
This works (for my site) on one.com, force www + https

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.sitename\.net$ [NC]
RewriteRule ^(.*)$ https://www.sitename.com/$1 [L,R=301]
Otsikko: Re: Default to https and SSL
Kirjoitti: Plantje - lokakuu 30, 2019, 10:09:06 AP
I think I need to look into this a little bit more as both scripts do not work for me.

If I use the one from you, a10, and go to "vliegvisserscom" I do see it get redirected to "https://vliegvissers.com" Whereas without the redirection it went for "http://www.vliegvissers.com/SMForum"

I need to look at this when I have some more time, I think
Otsikko: Re: Default to https and SSL
Kirjoitti: Plantje - lokakuu 30, 2019, 10:45:33 AP
Couldn't hold back...

Turns out in my index.php a redirect was already in place:
<?php
$host
=getenv("HTTP_HOST");
if(
$host == "www.vliegvissers.com") { $url "http://www.vliegvissers.com/SMForum/"; }
elseif(
$host == "vliegvissers.com") { $url "http://www.vliegvissers.com/SMForum/"; }


else { 
$url "https://www.vliegvissers.com/SMForum/" ; }
Header("Location: $url");
?>

Turns out I just needed to change that to https.


<?php
$host
=getenv("HTTP_HOST");
if(
$host == "www.vliegvissers.com") { $url "https://www.vliegvissers.com/SMForum/"; }
elseif(
$host == "vliegvissers.com") { $url "https://www.vliegvissers.com/SMForum/"; }


else { 
$url "https://www.vliegvissers.com/SMForum/" ; }
Header("Location: $url");
?>



However, website do still complain parts of the site are not secure
Otsikko: Re: Default to https and SSL
Kirjoitti: Shambles - lokakuu 30, 2019, 02:41:58 IP
Click the padlock and expand on the media that's insecure.

There are quite a few URLs in your setup that need amending...

(https://i.imgur.com/q9wIFLq.jpg)
Otsikko: Re: Default to https and SSL
Kirjoitti: Plantje - lokakuu 30, 2019, 06:10:34 IP
Is that a Firefox specific thing? Where can I find it on Edge, IE or Chrome?
Otsikko: Re: Default to https and SSL
Kirjoitti: Mick. - lokakuu 30, 2019, 09:57:30 IP
Make sure to change the url to https in admin, database and paths?
Otsikko: Re: Default to https and SSL
Kirjoitti: Mick. - lokakuu 30, 2019, 10:00:32 IP
Also hosted images from your server wont change to https from past posts or logos, banners etc. You would need to edit their URLs accordingly. There after you should be good
Otsikko: Re: Default to https and SSL
Kirjoitti: Plantje - lokakuu 31, 2019, 02:36:53 AP
Lainaus käyttäjältä: Mick. - lokakuu 30, 2019, 09:57:30 IP
Make sure to change the url to https in admin, database and paths?

The "Forum URL" is set to https. Should be good there...


Lainaus käyttäjältä: Mick. - lokakuu 30, 2019, 10:00:32 IP
Also hosted images from your server wont change to https from past posts or logos, banners etc. You would need to edit their URLs accordingly. There after you should be good
I was looking how to change that. And upon checking on my host's portal in the file manager, every file and folder from the root and down states "http" rather than "https". For example:
SMForum
Full path: http://vliegvissers.com/SMForum/
02/12/2018 | 487 items

That still doesn't seem right to me.