Trouble with Multiple Sites

Topics: Developer Forum
Feb 4, 2009 at 8:14 PM
Greetings,

I'm having trouble with the multiple sites functionality.  I'm using the basic template example from the download area.

I've created 4 different start pages - each of them has a different hostname.

Relevant Web.config info:
  <host rootID="1" startPageID="2" multipleSites="true" wildcards="true">
      <web extension=".aspx" ignoreExistingFiles="true" />
      <outputCache enabled="false" duration="10" />
    </host>

Note: I've tried with and without wildcards.

The problem:
The different themes and titles appear to work between the sites, but thats it.  The content itself is never right.

i.e. Take sites A-B
If I save the start page on Site A, then all sites will have the same content, but different themes.

If I then go and save the start page on site B, then Sites A,C,D have the same content as site B.

Make sense?

Thanks for the help!
Dustin


Coordinator
Feb 4, 2009 at 9:15 PM
Odd. Is this based on the templates project?

You could do some debugging. Modify the template (/default.aspx) and output:
  • The complete url including host name
  • CurrentPage.ID
  • All the details (CurrentPage.Details) of each page including their ID, Name and Value
Feb 5, 2009 at 2:07 PM
Edited Feb 11, 2009 at 5:34 PM
Discovered the problem...
sites:
http://www.scarycostumeideas.com/
http://www.trutip.com

Notice that they all claim the same hostname...

How is the hostname determined by N2?

Thanks,

Dustin


Coordinator
Feb 5, 2009 at 8:57 PM
The host is derived from here.

new Url(Request.Url.Scheme, Request.Url.Authority, Request.RawUrl)

What version of IIS are you using?
Feb 11, 2009 at 2:30 PM
Edited Feb 11, 2009 at 5:34 PM
I'm using II7.... I've tested with II6 locally and it works fine...

Thoughts?


Feb 11, 2009 at 2:35 PM
Edited Feb 11, 2009 at 5:34 PM
So basically the page id never changes... I've added debug output to show that the url is being picked up right... But the page id is always the first site that was loaded since the application started.... An exact copy of everything works fine under IIS 6.

Thoughts?



Feb 11, 2009 at 5:36 PM
This began to sound like caching and caching it was.

[discussion:43700] had the answer to my problem and now it works just as expected.

There appears to be a bug in the url cache that constantly sends the user to the same page regardless of the hostname being called.


Thanks again for all the help,
Dustin
Coordinator
Feb 11, 2009 at 7:59 PM
Yes, of course! I believe there's a fix for this in the trunk if you care to retrieve it and compile for yourself.