Multi-site/Multi-domain environment on MVC

Cassandra Snyder asked on January 7, 2021 20:43

I am trying to figure out the best way to approach our transition from Portal Engine sites to MVC. We have multiple sites with different domains. This was easy to set up with Portal Engine and be able to administer each site separately, such as access the content tree for each individual site by using the admin URL (www.a.com/admin) or the drop down site selector. There doesn't seem to be an easy way to do this with MVC. I am new to MVC and I am going through the Kentico MVC training module for Developers, however I haven't been able to discern exactly how one goes about setting up an environment like ours. We have www.a.com and www.b.com and www.c.com and several others all residing currently just fine in our Portal Engine environment. I can access the administration for each site separately.

I have attempted to set up two different sites in the way the documentation states, but am not able to access the content tree of the second site, only the content tree of the initial site that was set up. Using www.a.com/admin nets me the first site content tree, but www.b.com/admin only shows me the content tree of the first site and not the second. Can someone who might have experience with this setup please explain how you handled this? Maybe I'm missing something. Thank you in advance!

Correct Answer

Brenden Kehren answered on January 8, 2021 17:58

Cassandra,

To add to what Juraj provided, from a technical standpoint, you'll need:

  • 1 Xperience install, which consists of the Xperience code and a SQL database
  • 2 sites. A single site consists of a definition in the Xperience UI under the Sites application and an MVC code base that will connect to the same SQL database as Xperience does.
  • A base view to display a "hello world" example on each of the MVC sites.
  • configure each site to use the proper Admin and Presentation URLs.

So when you have a 2 site setup you will have the following setup from a code and database standpoint:

  • Xperience code base which connects to the Xperience database
  • Xperience database
  • 2 sites defined in the Xperience UI
  • Site 1 MVC code base, which connects to the Xperience database
  • Site 2 MVC code base, which connects to the Xperience database

Hopefully this helps your development setup and process.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on January 8, 2021 07:03

It is the same also when using MVC. There is the drop down list and what it does is that it redirects you to the other sites domain, just like when using Portal engine. For example I have two MVC sites and each has different domain set so I have them both in the drop down and when I select the other site, the admin UI refreshes, the URL domain is changed accordingly and now I can edit the second site. This is still the same and the MVC development model does not have any impact on this. It may just depend how you will configure your IIS and the actual web sites. For more details please see this KB article.

1 votesVote for this answer Mark as a Correct answer

Cassandra Snyder answered on January 8, 2021 22:05

Thank you both so much! This was the explanation I needed!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.