News:

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

Main Menu

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 !!!
"Put as much effort into your question as you'd expect someone to give in an answer"

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.

Be the person your dog thinks you are.

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
Сл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."

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?
"Put as much effort into your question as you'd expect someone to give in an answer"

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.

Be the person your dog thinks you are.

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).
Slava
Ukraini!


"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

How you can help SMF

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.
Slava
Ukraini!


"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

How you can help SMF

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

Сл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."

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

shanamendez

thanks for your guide i have following your guideline and Convert my perfect essay writing website HTTP to HTTPS.

Karmasterrr

One general issue is not covered by the guide:
After migration to https, old posts contain old links to http:// forum topics, posts (messages) and images.
This should be fixed for SEO reasons.
I thought option "force SSL" in admin settings could fix it, but it is not.

Is there any mod already for that or should I write a new one? (SMF 2.1 RC3)

Kindred

No mod...
But,no mod needed

Just set your htaccess to force redirect all http urls to use https
Сл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."

Karmasterrr

Quote from: Kindred on January 29, 2022, 04:08:03 PMNo mod...
But,no mod needed

Just set your htaccess to force redirect all http urls to use https
Redirect already works and forum works, but that is not what I am addressing. SEO!

Arantor

And the SEO part will be just fine if the redirect is set to use 301 redirects.

If you honestly must rewrite the links - and it's honestly not necessary - REPLACE() in MySQL is your friend, e.g.

UPDATE smf_messages SET body = REPLACE(body, 'http://example.com/', 'https://example.com/');
Since this is a one-way only change, do a backup first just in case.

Narheru

#158
Hello There!
I'm trying to update my forum at httpS url, but it doesn't seem to work. I'm using an SSL certificate given by my hosting. I followed every steps and inside the repair_settings.php I also have seen the updated urls to "httpS", but still, the forum is not working.
QuoteNot Found
The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Right now I cannot access either to the repair_settings file.

The url is https://www.dcleaguers.it/forum/index.php

I don't know if it can help, but I cannot convert either my Wordpress installation in the root folder. It seems to not work for some reason :/. If I write https://www.dcleaguers.it/ it doen't work. The only mod that I can think of to create some problem would be "Pretty urls", but It affect also the wordpress installation, so maybe is something esle wrong...

Ah, at least but not last, this is my .htaccess file
<Files "xmlrpc.php">
Order Allow,Deny
deny from all
</Files>

# BEGIN WordPress
# Le direttive (linee) tra `BEGIN WordPress` e `END WordPress` sono
# generate dinamicamente, e dovrebbero essere modificate solo tramite i filtri di WordPress.
# Ogni modifica alle direttive tra questi marcatori verrà sovrascritta.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# RewriteCond %{HTTP_REFERER} !^$
# RewriteCond %{HTTP_REFERER} !^http://dcleaguers.com/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://dcleaguers.com$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://dcleaguers.it/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://dcleaguers.it$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://flash.dcleaguers.it/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://flash.dcleaguers.it$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://google.com/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://google.com$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://google.it/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://google.it$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://images.google.com/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://images.google.com$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://images.google.com*/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://images.google.com*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://www.dcleaguers.com/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://www.dcleaguers.com$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://www.dcleaguers.it/.*$      [NC]
# RewriteCond %{HTTP_REFERER} !^http://www.dcleaguers.it$      [NC]
# RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://25.media.tumblr.com/tumblr_m86g42z3Vy1qet655o1_250.jpg [R,NC]
.

I "inherited" this webstie, so...I don't it very well for now.


Edit: I SOLVED it by myself. Enabling the SSL urls the forum (and the site) was redirecting to the private_html instead of the public_html. I enabled a symbolic link between the two folders and the problem was solved. Thanks!

andy12gr

I have the site https://stray-animals.com
Yestarday i buy ssl cert, for 1 day all ok
but i have a message
Secure Connection Failed

An error occurred during a connection to stray-animals.com. Peer's Certificate has been revoked.

Error code: SEC_ERROR_REVOKED_CERTIFICATE

any help?

Advertisement: