Multi site content administration MVC

Mark Elliott asked on December 11, 2019 20:25

So here is something I've been scratching my head about and can't seem to find a clear solution/example anywhere. With MVC in the case where you are going to manage multiple sites content in the same mother how do you distinguish the content tree for each site so the editors of each site are managing only their content? How does www.siteA.com/admin know to pull the content tree for SiteA and www.siteB.com/admin know to pull the content for SiteB?

Mark

Recent Answers


Juraj Ondrus answered on December 11, 2019 20:43

I believe that this article could give you some hints and answers. But in general - you will set the domain names for each site separately, and Kentico will load the content based on the current domain in the URL.

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on December 11, 2019 21:39

Hi Juraj

Thanks for the fast response. I have seen that article. It is good from a high level conceptual view but some of the implementation details are still a little unclear. For example we will have a single MVC application with the same code base managing the URLs. So that means for routing to the admin URL we will have a single key in the web.config with an entry like:

<add key="MVCAdminUrl" value="https://www.domain.com/Kentico12_Admin" />

If the admin URL for all the sites point to the same domain how is it going to know which site is going to be administered?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 12, 2019 08:08

This is also explained in the article - you need to use some kind of domain controller which will handle this or some middle-ware or route handlers to let the Kentico admin app know what the domain is to load the site. So, basically you won't be using that web.config key and you will set your own admin URLs and your editors will have to bookmark them since the /admin redirection will not work in this case.

0 votesVote for this answer Mark as a Correct answer

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