Minesh Shah (Netcel)
Jul 12, 2022
  2032
(2 votes)

Local Multi-Site Setup for CMS12

Many solutions these days are Multi-Site enabled, with CMS 11 and using IIS it was simple to add multiple bindings to the same solution. With CMS12 when not using IIS it was not clearly documented on how to create multiple host names although it transpires this is very simple to achieve via the Program.cs class. 

To do this we can utilse the UseUrls extention on the WebHostBuilder and add the URLS as comma delimated parameters for the web host to listen on i.e. 

public class Program
{
    public static void Main(string[] args) => CreateHostBuilder(args).Build().Run();

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureCmsDefaults()
            .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>()
            .UseUrls("https://localhost:5001", "https://localhost:5002"));
}

Jul 12, 2022

Comments

Muhammad Kashif
Muhammad Kashif Jul 12, 2022 09:27 PM

Excellent piece of information thanks for sharing Minesh

Please login to comment.
Latest blogs
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024