• Welcome to Simple Machines Community Forum. Please login or sign up.
December 01, 2021, 02:13:33 AM

News:

Wondering if this will always be free?  See why free is better.


Converting to https, step-by-step...

Started by shawnb61, July 08, 2017, 03:01:04 AM

Previous topic - Next topic

landyvlad

I had certificate installed wrong - host has sorted it and now working. Thanks all !!!
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

shadav

guess I'll update, came back around to this again last week on my one site (the forum that was on a subdomain) that wasn't working
tried again and still wasn't working
then I went and played with cloudflare settings and it all started working
however I had to skip adding the code into my .htaccess otherwise I kept getting too many redirect errors

but finally all of my sites are converted to https
Thanks for all the help

side note, if you use mods you will need to check their settings in the admin and make sure to change any http over to https
I also had to make changes to some source files and in my database
and of course anywhere in the template files where I hard coded an image or url

Kindred

Quote from: shadav on September 27, 2021, 05:53:06 PMtemplate files where I hard coded an image or url

We would you use full urls?
I always use relative urls for hard coded links and images
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shadav

Quote from: Kindred on September 27, 2021, 10:06:33 PM
Quote from: shadav on September 27, 2021, 05:53:06 PMtemplate files where I hard coded an image or url

We would you use full urls?
I always use relative urls for hard coded links and images
the images aren't in the subdomain, they are located on the main domain and the urls point to external links

but yes you are correct, if I was using images and urls based off the forum's path I would use relative paths/urls instead

but the site in question is a fansite so the urls are to the creator and ways to donate/support them

landyvlad

Hmm so now I am getting occasional 403 errors but when I forced refresh I got through to the site.
ytyak.co,

any suggestions?
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

shadav

Quote from: landyvlad on September 27, 2021, 10:44:59 PMHmm so now I am getting occasional 403 errors but when I forced refresh I got through to the site.
ytyak.co,

any suggestions?

I'm getting error
DNS_PROBE_FINISHED_NXDOMAIN
when visiting the link

Aleksi "Lex" Kilpinen

Quote from: landyvlad on September 27, 2021, 10:44:59 PMHmm so now I am getting occasional 403 errors but when I forced refresh I got through to the site.
ytyak.co,

any suggestions?

ytyak.co doesn't seem to exist according to my DNS - NXDOMAIN (50.7ms)
And it would appear to be available for purchase (did a quick test through GoDaddy domain search).
A Finnish Project Manager (Support Specialist)
 Happily running multiple SMF 2.x installations.
  Fooling around with i7-10700 @ 2,90GHz-4.80GHz / 16Gb / RTX-2070 Super / 3840x2160 / Win 10 x64


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Aleksi "Lex" Kilpinen

Ah, the wwwRedirect seems to trigger a 403. Should be logged in the server's error log, I'd suspect it's most likely some security feature on the server getting a kick out of the redirect for some reason.
A Finnish Project Manager (Support Specialist)
 Happily running multiple SMF 2.x installations.
  Fooling around with i7-10700 @ 2,90GHz-4.80GHz / 16Gb / RTX-2070 Super / 3840x2160 / Win 10 x64


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

shadav

fyi if using cloudflare don't put the redirect in the htaccess
just use cloudflare's settings to redirect http to https

Dr Web

I just installed a new 2.0.18 smf forum. My host installed the certificate on my server so I already can access my site through https without any errors or warnings.

Now I want to redirect http://mysmfforum.pt and http://www.mysmfforum.pt to https://www.mysmfforum.pt

Resuming, I want to redirect non www and www to https://www

How do I do this? Simply using the code below that is on the first post of this topic?

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Never approach a bull from the front, a horse from the rear, or an idiot from any direction ;D

Kindred

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Dr Web

First all was ok, and only mysmfforum.pt was not redirecting properly, it was redirecting to https://mysmfforum.pt, not forcing the www, and the site was looking weird, without template, but now it's redirecting and working well.

Thank you.

Never approach a bull from the front, a horse from the rear, or an idiot from any direction ;D

Advertisement: