This project is read-only.

Trouble with Multiple Sites

Topics: Developer Forum
Feb 4, 2009 at 9:14 PM

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" />

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!

Feb 4, 2009 at 10: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 3:07 PM
Edited Feb 11, 2009 at 6:34 PM
Discovered the problem...

Notice that they all claim the same hostname...

How is the hostname determined by N2?



Feb 5, 2009 at 9: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 3:30 PM
Edited Feb 11, 2009 at 6:34 PM
I'm using II7.... I've tested with II6 locally and it works fine...


Feb 11, 2009 at 3:35 PM
Edited Feb 11, 2009 at 6: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.


Feb 11, 2009 at 6: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,
Feb 11, 2009 at 8: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.