KeyKiller
KeyKiller

Reputation: 77

Host multiple sites on one domain with IIS

I have few web apps: ASP.NET MVC 4.5, ASP.NET CORE MVC 3/6 and also blazor wasm hosted on ASP.NET CORE 6. I want to hosst them on one domain with different paths as roots. Like this:

mydomain.com/firstsite
mydomain.com/secondsite
mydomain.com/thirdsite

and etc. Can I do it somehow on Windows Server 2016 with IIS? Every site use his own authenticication and cookies.

Upvotes: 1

Views: 1897

Answers (1)

Jason Pan
Jason Pan

Reputation: 21997

Of course you can achieve this requirement, we can add virtual application under IIS site.

enter image description here

Mytest Steps

1. Setings in IIS

enter image description here

2. Important point, please note.

If we set the main site to .net framework, then the virtual application .net core site should recreate an application pool.

Because the application pool of .net core should choose No Manage Code type.

3. In your blazor webapp, you need change the default path like below.

Add the virtual path in your index.html file.

enter image description here

Upvotes: 2

Related Questions