Copied to clipboard

Flag this post as spam?

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


  • Steve Milligan 11 posts 77 karma points
    May 27, 2019 @ 11:59
    Steve Milligan
    0

    Courier with Culture and Hostnames

    Hi

    Is there a way of ensuring that the Culture and Hostnames settings do not get couriered from one environment to another?

    We have an issue that, when Couriering home nodes from staging to live, Courier is adding the staging mappings to the live Culture and Hostnames settings. It doesn't overwrite, it appends.

    Umbraco version is 7.10.5 Courier version is 3.1.6

    Thanks in Advance

    Steve

  • Yakov Lebski 591 posts 2347 karma points
    Jun 19, 2019 @ 20:45
    Yakov Lebski
    0

    Hi, the solution is SiteDomainHelper, you should define both domains on staging and live environment. Your live environment is a copy of your staging, you shouldn't modify it.

    In startup, OnApplicationStarting

       AddDomain("www", "live.domain.com,live2.domain.com");
                        AddDomain("staging", "staging.domain.com,staging2.domain.com");
     private static void AddDomain(string key, string domains)
            {
                if (!string.IsNullOrEmpty(domains))
                {
                    SiteDomainHelper.AddSite(key, domains.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
                    SiteDomainHelper.BindSites(key);
                }
            }
    

    In this situation, Umbraco will show only domain that appears in each group

Please Sign in or register to post replies

Write your reply to:

Draft