patrickdemooij9 / SeoToolkit.Umbraco

SeoToolkit is a SEO package for Umbraco 9, 10, 11, 12 & 13. This package features most functionalities needed for your SEO needs like meta fields, sitemap, robots.txt and much more.
MIT License
34 stars 28 forks source link

Canonical Url uses http://domain.com instead of https://domain.com #233

Closed DanielOberlechner closed 11 months ago

DanielOberlechner commented 11 months ago

Hi, I have the problem provided in the title. If I test locally it uses https://localhost/ but with my live url it uses http. https://danobe.dev is my website.

Is there any workaround or am I the only one with this problem? Google Search Console made realise this error.

Kind regards, Daniel Oberlechner

patrickdemooij9 commented 11 months ago

Hi @DanielOberlechner

That is indeed strange. I assume that you are using %CurrentUrl% for this? The underlying code for that just calls the .Url() function of Umbraco. Do you perhaps have your application url set to http? https://docs.umbraco.com/umbraco-cms/extending/health-check/guides/fixedapplicationurl

DanielOberlechner commented 11 months ago

Bildschirmfoto 2023-09-19 um 11 42 42 I'm using the provided input from the picture. I use in HTML the helper. In the appsettings I don't have a URL provided. I've changed that and deployed one but it seems it doesn't bring the wanted change.

When I set manually the Canonical URL to my websites domain, it works, but specifically the fallback doesn't work

P.s in the appsettings under CMS:Global I don't enforce https:true because when I want to login in Umbraco I get too many redirects... could that be the issue? *Nope, didn't fix the issue...

Any more ideas how to fix this issue?

Kind regards, Daniel

patrickdemooij9 commented 11 months ago

Still not quite sure how this is going wrong then... I also see the same issue with your og:image being returned with http instead of https. I still suspect it is Umbraco related instead of SeoToolkit related, but not quite sure what causes it. Could you also try setting the UmbracoApplicationUrl? https://docs.umbraco.com/umbraco-cms/reference/configuration/webroutingsettings. I actually meant to send that one instead of the earlier link.

DanielOberlechner commented 11 months ago

I use as setup Cassandra in connection with Caddy web server, which provides https certificate for my website. My Umbraco settings are quite all on default, which specific setting do I have to change to let the website know that I operate on https? Caddy is a reverse proxy which handles traffic in https. I guess Cassandra runs still in http mode probably ...

I've configured appsettings as the following:

      "WebRouting": {
        "UrlProviderMode": "Auto",
        "UmbracoApplicationUrl": "https://danobe.dev"
      },

is there anything more I can try? Daniel

patrickdemooij9 commented 11 months ago

Then I am not sure, sorry... I assume it has to do with the reverse proxy, but I don't have experience with them. You should be able to reproduce it outside of SeoToolkit if you do an .Url(mode: UrlMode.Absolute) on a page or media item. Might be best to ask someone in the Umbraco Discord group if they can help with the setup

DanielOberlechner commented 11 months ago

Thank you for your answer I'll ask in the Umbraco Discord if somebody can help me out with this specific issue!