Advertisement:

Author Topic: Converting SMF 2.0.12 from HTTP to HTTPS  (Read 1507 times)

Offline nhrsutton

  • Newbie
  • *
  • Posts: 3
Converting SMF 2.0.12 from HTTP to HTTPS
« on: November 25, 2016, 12:44:15 PM »
So I am currently hosted using Siteground. I had them convert things to HTTPS. After the conversion I manually changed the settings file board url to HTTPS.  I also had them run the repair_settings.php.  What happened was that no users could login after that. You would enter your user name and password and it would ask you to please enter your username.  It was an endless loop.  I had them convert back to HTTP to get it working again.  Is there a guide on how to do this properly?  I don't want to have them convert to HTTPS again without having a handle on the process. Many thanks to any help.
« Last Edit: November 25, 2016, 01:03:20 PM by nhrsutton »

Offline radu81

  • Jr. Member
  • **
  • Posts: 315
  • Gender: Male
Re: Converting SMF 2.0.12 from HTTP to HTTPS
« Reply #1 on: November 25, 2016, 04:07:11 PM »
Smf can work with https, you need to change the board url to https and also all the paths for your template,  attachments, avatars etc.
You will also need to edit your .htaccess file to redirect the http version to https version.
Don't forget about analytics and webmaster tools to change your address to https. In analytics there is an option for this change, in webmaster tools you need to add it as a new website.

To be honest I did not search if there is a mod to cache the images inserted with IMG tag, on those pages you will get some certificate error if the images are hosted on http
« Last Edit: November 25, 2016, 08:29:24 PM by br360 »
sorry for my bad english

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,428
  • Gender: Male
    • Kindred-999 on GitHub
Re: Converting SMF 2.0.12 from HTTP to HTTPS
« Reply #2 on: November 25, 2016, 05:14:19 PM »
I just bought certs and switched all of my sites over to https...  exactly as radu says
« Last Edit: November 25, 2016, 06:12:16 PM by Illori »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline radu81

  • Jr. Member
  • **
  • Posts: 315
  • Gender: Male
Re: Converting SMF 2.0.12 from HTTP to HTTPS
« Reply #3 on: November 25, 2016, 08:51:43 PM »
You will also need to edit your .htaccess file to redirect the http version to https version.
That will do the trick inside .htaccess file:
Code: [Select]
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=302,L]
use 301 instead of 302 if the redirect is permanent

Quote
To be honest I did not search if there is a mod to cache the images inserted with IMG tag, on those pages you will get some certificate error if the images are hosted on http
I searched the mod site but I didn't find a solution for this
sorry for my bad english

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,290
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Converting SMF 2.0.12 from HTTP to HTTPS
« Reply #4 on: November 30, 2016, 06:41:46 PM »
I have just gone through this and have also posted the simple change to repair_settings.php to set the correct https URLs ... once the .htaccess is right then run my https version at http://www.simplemachines.org/community/index.php?topic=550197.msg3901127#msg3901127

That makes the whole process easier and failsafe once you sort out the certs.

Note that this is not sanctioned by SMF and is just a suggestion by regular member so no responsibility accepted.
Linux CentOS VPS running SMF 2.0 with 140+ mods installed (the full h/w and s/w can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)