I’ve got an Umbraco Cloud environment that hosts multiple websites. I’m trying to find a way to prevent Umbraco finding content for a request that doesn’t match the domain configured on the root node.
For example, I have two sites configured with domain1.com and domain2.com respectively. Right now, if someone browses to the default project-name.uksouth01.umbraco.io domain. Umbraco will serve the first root node it finds, even if it isn’t configured with that domain name.
I found that there used to be a setting for this called useDomainPrefixes which may have been replaced with the following.
But it seems this only works for the URLS displayed in the Backoffice content info screen and doesn’t affect routing.
Anyone have a solution for this or can point me to the right customisation point? It feels like the documentation isn’t quite up to date with V15 changes.
I turned on debug logging and looked at the code, seems like the UrlProviderMode setting doesn’t get checked during routing and the IContentFinder implementation makes use of IDocumentUrlService which in turn doesn’t check this setting either.
The IDocumentUrlService falls back to finding the first root content node inside a private method.
I consider this behaviour as a bug, so I’ve raised issue #19010
Hmm, never thought of that. Our root nodes don’t have templates (because they are usually containers), so it will just cause a 404, but it DOES try to server the first root node it finds. This has been the behaviour as long as I can remember.
The UrlProviderMode is for how urls are generated, but how routing is handled as far as I know.
Not sure if I should consider this a bug, but behaviour that was intended like this. But a setting where you can disable serving content when the domain is not mapped in any cultures and hostnames would be nice I guess Well see about your bug report, maybe it will be moved to discussions.