Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

Multiple sites with the same base domain Options
banderson
Posted: Thursday, March 12, 2009 1:44:25 PM
Rank: Newbie
Groups: Member

Joined: 3/12/2009
Posts: 7
Points: 21

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
Posted: Thursday, March 12, 2009 1:52:08 PM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
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
Posted: Friday, March 13, 2009 12:12:09 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
banderson wrote:

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


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
Posted: Friday, March 13, 2009 12:14:41 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Constructor wrote:
Use subdomains or different domain names altogether, they both work.


Virtual directories only also does the trick.

Quote:

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 happy
Constructor
Posted: Friday, March 13, 2009 1:51:56 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
martijnb wrote:
A little offtopic, but this is also new functionality in Cuyahoga 2.0 happy


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
Posted: Friday, March 13, 2009 5:52:40 AM
Rank: Newbie
Groups: Member

Joined: 3/12/2009
Posts: 7
Points: 21
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...
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.