Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Edward Anderson 6 posts 76 karma points
    Jun 04, 2019 @ 12:55
    Edward Anderson
    0

    Multi-site Umbraco set-up populating links with incorrect URL

    Hi all,

    I'm running multiple sites in one Umbraco instance, but have (seemingly recently) started to receive reports that users will be directed to the wrong website (still one of our websites) when links are clicked.

    I've used automated software to click between the links and this does occur - the interesting part being that it is the URL of the link that is wrong, not the website that is displayed (until the link is clicked, of course).

    I'm not sure why Umbraco would display one website but then populate the links on that site with the URLs of a different site seemingly at random (the automated tests showed no pattern). Has anyone else encountered this issue?

    Kind regards, Ed

  • Daniel 2 posts 72 karma points
    Jun 05, 2019 @ 05:52
    Daniel
    0

    Hi, I have a somewhat similar issue with multiple sites in one Umbraco instance:

    https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/97580-multi-site-randomly-wrong-content

    Links have also been reported wrong as in your case sometimes. I was suspecting GetByRoute getting wrong from xml cache but not really sure. Currently trying to understand if "HideTopLevelNodeFromPath" set to true is correct for a multisite

  • Edward Anderson 6 posts 76 karma points
    Jun 05, 2019 @ 08:22
    Edward Anderson
    0

    With some testing, I think what's happening is:

    • Person A clicks a link on site A for page A
    • While site A page A is loading, Person B goes to site B (somewhere in the world)
    • Umbraco somehow gets confused about this, and then serves site B's information to Person A, instead of site A

    I tested this by having a Selenium script click between two links on one site, and then I kept requesting different sites that we have in the Umbraco instance in a separate window while those pages load.

    I'd be interested to hear if you can get this error to replicate using a similar method with your sites?

  • Darren Welch 23 posts 136 karma points c-trib
    Jun 05, 2019 @ 09:48
    Darren Welch
    0

    Are you using a cached partial to load your navigation?

    It could be that

    • Person A accesses the page www.mywebsite.com/en (the navigation is cached on the server)
    • Person B accesses the page www.mywebsite.com/de, the navigation is then served from the cache.
  • Søren Gregersen 299 posts 1182 karma points MVP c-trib
    Jun 05, 2019 @ 07:36
    Søren Gregersen
    0

    hi,

    do you have any examples of how you render your links? also how do you fetch the content that is rendered?

    we are hosting 100 sites in a single instance, but have never heard of issues like this.

    Normally urls are relative (@Model.Url => /about/us) but if you force absolute urls the protocol and domain is included in the link (Model.AbsoluteUrl => https://domain.com/about/us)

  • Edward Anderson 6 posts 76 karma points
    Jun 05, 2019 @ 08:24
    Edward Anderson
    0

    The links are generated from I believe IPublishedContent.Url as the list of links is populated from a content picker in the Umbraco back end. Maybe this is the issue?

  • Søren Gregersen 299 posts 1182 karma points MVP c-trib
    Jun 05, 2019 @ 09:16
    Søren Gregersen
    0

    if an editor selects links from outside their own site? yes, that could be an issue

  • Edward Anderson 6 posts 76 karma points
    Jun 07, 2019 @ 14:38
    Edward Anderson
    0

    Thank you for the replies, everyone. I have now fixed this issue (as far as I can tell), so in case anyone else thinks they might have a similar problem, I'll talk about my solution.

    On some further debug probing it turns out whoever wrote the code decided to use static variables in a shared model logic class, meaning that information about different websites was being retained while it was rendering models, hence why it was serving up websites with the incorrect link URLs etc.

    Once again, thank you to everyone who replied to this thread :)

Please Sign in or register to post replies

Write your reply to:

Draft