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! :)
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!
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:
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é
Hi Corne,
Can you share some code for the UrlProvider and content finders ? That would be helpful in troubleshooting.
Dave
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é
is working on a reply...