Copied to clipboard

Flag this post as spam?

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


  • Corné Hoskam 81 posts 588 karma points MVP 3x c-trib
    Nov 23, 2021 @ 13:00
    Corné Hoskam
    0

    Custom IUrlProvider issues with same path on multi-domain

    Hi fellow Umbracian!

    We are currently running into an issue with an Umbraco 8.17 Multi-Domain (2 domains) instance, when using a custom UrlProvider for one specific branch of Nodes of both domains. Our Umbraco instance and the domains are structured as follows:

    - Homepage of Domain A (With Domain A)
      -DomainACollection
       -Blogs
         -"A random blog here"
       -News
         -"A random news article here"
    - Homepage of Domain B (With Domain B)
      -DomainBCollection
       -Blogs
         -"A random blog here"
       -News
         -"A random news article here"
    

    Using a combination of an Url Provider & Content Provider, we are removing the "DomainACollection" and "DomainBCollection" from the Urls, so we end up with a canonical friendly URLs of htps://domain-a.com/blogs/a-random-blog-here and htps://domain-b.com/blogs/a-random-blog-here.

    Sadly though, Umbraco seems to be confused when determining the Urls for the second domain. Both domains have different Domain/Host URLs, but have the same Blogs folder. The AbsoluteUrl is different, but Umbraco doesn't allow the second domain /Blogs and /Blogs/* to be routeable, with a "This document is published but its URL would collide with content /Domain A/DomainACollection/Blogs", while only the relative Urls would collide, the absolute Urls wouldn't, seeing as they are both on different domains.

    EDIT: Attaching a Debugger to the final line of the UrlProvider where I return an instance of UrlInfo() also shows that the final Urls are different, seeing as they are absolute URLs. These urls are "htps://domain-a.com/blogs/" and "htps://domain-b.com/blogs/", but the backoffice still determines them as Colliding.

    Any help or nudge into the right direction would be much appreciated! :)

    Kinds Regards,

    Corné

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Nov 23, 2021 @ 18:37
    Dave Woestenborghs
    0

    Hi Corne,

    Can you share some code for the UrlProvider and content finders ? That would be helpful in troubleshooting.

    Dave

  • Corné Hoskam 81 posts 588 karma points MVP 3x c-trib
    Nov 24, 2021 @ 12:16
    Corné Hoskam
    100

    Hi Dave,

    After posting my question, some other kind people from the community pointed me towards the Virtual Nodes package, which resolved exactly what I needed to do! No need to reinvent the wheel myself!

    For future reference: https://github.com/christopherrobinson/Virtual-Nodes-for-Umbraco-8

    Thank you anyway! 😄

    Kind regards,

    Corné

Please Sign in or register to post replies

Write your reply to:

Draft