November Happy Hour will be moved to Thursday December 5th.

Minesh Shah (Netcel)
Jul 12, 2022
  2305
(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
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog