Converting SMF 2.0.12 from HTTP to HTTPS

Started by nhrsutton, November 25, 2016, 12:44:15 PM

Previous topic - Next topic

nhrsutton

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.

radu81

#1
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
sorry for my bad english

Kindred

#2
I just bought certs and switched all of my sites over to https...  exactly as radu says
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

radu81

Quote from: radu81 on November 25, 2016, 04:07:11 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:
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=302,L]

use 301 instead of 302 if the redirect is permanent

QuoteTo 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

aegersz

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.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: