This project is read-only.

Managing multiple websites using the same N2 engine

Topics: Developer Forum
Feb 8, 2008 at 5:27 PM
Hi everyone,

Could it be possible to have a single N2 engine which manages the content of multiple domains. I think there was a post time ago explaining how to do that but I haven't been able to find it.
I don't know how could it work, maybe the root could have a child item for each domain:
  • Root
    • First domain
      • First domain main page.
      • First domain contact us page.
      • etc.
    • Second domain
      • Second domain main page.
      • etc.

Any suggestion/idea will be welcome,
Thanks!
Feb 9, 2008 at 12:18 AM

Could it be possible to have a single N2 engine which manages the content of multiple domains.


This is the post were looking for. Since it's a good question and implementing this is far from as easy as it could be I added a little tutorial: run N2 CMS with multiple domains.

Hope it helps. I spoke to a user with another solution which hopefully will be available somtime.

/Cristian
Feb 12, 2008 at 3:24 PM
Thanks a lot libardo, the tutorial seems very clear.
Feb 18, 2008 at 11:12 PM
Hello again libardo,

I'm having problems in order to upgrade to 1.3.2. Could you explain which bug has the old version (1.3.0)? How important is it to upgrade?
Feb 19, 2008 at 8:05 AM
There's a changelog in /src/docs/history.txt. I can't say what's new to make it worthwile for you. What problems are you having? Maybe it's something easy.
Feb 19, 2008 at 4:07 PM
Edited Mar 3, 2008 at 5:26 PM
I've succesfully upgraded to 1.3.2 and it worked fine, I just had to rebuild some custom libraries (didn't realise last night ¬¬). The multiple sites run now using the same N2 engine :P.

Thank you very much for the tutorial!
Aug 10, 2008 at 8:17 PM
Hello!!

I have some questions about the multiple sites feature.

Do the pages with a different host name have to be on the second level only or may I enter a host name anywhere in my content tree and make that host name open that page?

What triggers N2 to update its "routes" to the newly entered hosts? I experience that it takes "a while" btween entering the host name and when it becomes available for browsing. If true, can I manually trigger that update?
Aug 10, 2008 at 8:31 PM
Another wierd thing is that the DragDropControlPanel is only visible for the very first page I created.

I have about 10 start pages (with different host names) under my root page and it's only one of them that have the DragDropControlPanel visible.

Can I set the visibility of that panel somewhere?
Aug 10, 2008 at 10:24 PM
There is a service that looks through the site during initialization and finds "sites". At the moment it's configured to only look at the first level but it's possible to change.

The routes are updated during startup. It's also possible to update the sites dynamically: ((MultipleSitesParser)N2.Context.Current.Resolve<IUrlParser>).Sites.Add...

Might it be that you're not logged in anymore once you change domain?


Aug 11, 2008 at 12:16 AM
Regarding the DragDropControlPanel - you are right..

It is because I'm not on the same domain and therefore not properly logged in (although I may still edit the page).

Maybe the SecurityManager has to be updated to support this special case..?

Anyway.. thanks for an excellent CMS.. I love it..!