Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We have a single site with where we have set multiple hostnames on the home node:
The issue we have is if you view the site on customer.site.co.uk, some of the navigation is returning the links with member.site.co.uk in the url instead of customer.site.co.uk
We're creating the navigation using:
var parent = Model.Content.AncestorOrSelf(2);
var pages = parent.Children.Where(x => x.IsVisible());
When dubugging the site running on customer.site.co.uk, the Url for Model.Content is member.site.co.uk which happens to be the first Url on the properties tab for the Home node.
Is this expected behaviour, how can we get it to respect the domain that your viewing the site on?
Firstly, I wouldn't do this, as you'll then have the same content being served on multiple domains. I'd map only one site and then use redirects in IIS/Web.config to redirect all the other domains to your prefered "canonical" domain.
But if you are determined, then you can utilise Events in Umbraco You'll need to create a class that inherits from IApplicationEventHandler, as described in the docs. Then you can use the SiteDomainHelper class (in Umbraco.Web.Routing namespace) to register your prefered domain. See at the bottom of https://our.umbraco.org/Documentation/Reference/Routing/Request-Pipeline/outbound-pipeline
protected override void ApplicationStarting(…)
The 2 sites serve different content from a CRM, but the structure and templates are shared.
I think the issue was that the dev site runs on http and not https, but the hostname was https.
I'd be curious as to why you would do this, are you wanting to change the behavior between members and customers - if that is the case using member groups would be a better solution?
Also, why would you have seemingly test instances inside your live umbraco instance?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted