Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# banderson 3/12/2009 10:44 PM

I'm trying to figure out how to have multiple Cuyahoga sites with the same domain name. i.e. have these load two different sites:
http://www.mydomain.com/site1
http://www.mydomain.com/site2

Right now that just throws an exception when loading the site: NHibernate.NonUniqueResultException: query did not return a unique result: 2

After some looking around, it looks like the only way to change that is to modify the Core and Web projects (SiteService for site lookup, and UrlHelper.GetSiteUrl to return more than just the base domain), but I'm not sure what other issues might spring up once I do that. I could also try creating my own SiteService and inject it with Windsor container, but I'm not too sure what that would lead to.

Has anyone else had any experience with this?


Any feedback would be much appreciated!

Thanks,
Ben
# Constructor 3/12/2009 10:52 PM (edited 3/12/2009 10:54 PM)
Use subdomains or different domain names altogether, they both work.

I have multiple sites like this:

1) Log into your admin.
2) Click add a new site.
3) Give your site a name and in the 'Site url (incl. http://)' box add the address of your site (eg http://site1.mydomain.com). You can test locally by adding a new virtual directory that points to Cuyhoga.
4) Add nodes and sections etc...

This works for me. I have also added site specific templates, file uploads (for FCK also) and users etc.

Hope this helps.
# martijnb 3/13/2009 9:12 AM
bandersonI'm trying to figure out how to have multiple Cuyahoga sites with the same domain name. i.e. have these load two different sites:
http://www.mydomain.com/site1
http://www.mydomain.com/site2

Create two virtual directories that point to the same Cuyahoga installation and then create two sites in the admin that point to the virtual directories. You also have to include the virtual directory name in the site url, otherwise you'l get the duplicates error.
# martijnb 3/13/2009 9:14 AM
ConstructorUse subdomains or different domain names altogether, they both work.

Virtual directories only also does the trick.
This works for me. I have also added site specific templates, file uploads (for FCK also) and users etc.

A little offtopic, but this is also new functionality in Cuyahoga 2.0 :)
# Constructor 3/13/2009 10:51 AM (edited 3/15/2009 10:04 PM)
martijnbA little offtopic, but this is also new functionality in Cuyahoga 2.0 :)

I though that would be where it was going. I am really looking forward to moving to it. I have had a look at the trunk version.

There is another feature I am looking at. The possibility of using either '.hbm.xml' files or Fluent configuration and mapping.

I have had a few tests working but still have yet to decide the best way to do it. There is the option for using just Fluent (as this is what I want to use) but it is better to have the choice.

Again, apologies for being off topic! But if any advice you could give (a post exists here).
# banderson 3/13/2009 2:52 PM
Thanks for all the help guys, I really appreciate it! I'm also glad I don't have to modify the Core project...


p.s. I'm REALLYY excited about the changes for 2.0, but I haven't gotten a chance to play with it yet. Hopefully soon! MVC, Fluent NHibernate, and LINQ to NHibermate are high on my list of things to try...