I am on Umbraco 17 with a muti-site setup that has both a staging and production environment. Each environment has a different TDL (.com and .dev) I stup the hosts information for each site so that it has both it’s production and staging hosts name setup. But in staging I see that the URLs generated between documents on other sites (i.e. a.site.dev linking to b.site.dev) defaults to the production URL and not the staging. (i.e. a.site.deve links to b.site.com instead of b.site.dev when generating URLs between documents). Is there some way of changing this behavior?
Presumably you have different DB’s for production and staging.. so do you really need the prod/staging hosts info on the nodes in both databases? (avoid this issue at root?)
I seem to have a recollection of looking into this in previous releases and it’s down to the core discovery simply looking at the do we have a domain for this node that’s different to the current page domain, if so then take the first domain in the umbracoDomains table.
Something like here
Umbraco-CMS/src/Umbraco.Core/Routing/DefaultUrlProvider.cs at main · umbraco/Umbraco-CMS
You might be able to find a service to override where the domainuri selected takes to matching on the TDL as a priority.. but I’ve not had the inclination to look that far ![]()
PS also had issues where UmbracoApplicationUrl (link) for the environment can only be a single url, so things like urls in backoffice pwd reminder emails will be that url and not necesarrily either/or of the two hosts you have you want.
Could be the DomainUtilities that you need to replace with your own implementation?
Umbraco-CMS/src/Umbraco.Core/Routing/DomainUtilities.cs at main · umbraco/Umbraco-CMS
I’m still not sure about when the setup is here? It’s one installation with both staging and production environments? How does that work?
I read it as two environments but with the DB’s having all the culture/hostnames, to make life easier when pulling Prod DB back to a staging DB and not having to remember to mess with the culture/hostnames for the multisite nodes..
But that’s my (not so) educated guess… ![]()
Sorry for not responding sooner. I do appreciate everyone’s input.
Mike is correct. I have two separate environments. One for Staging and one for Prod. Each environment has it’s own DB and is it’s own installation.