Multiple Sites using Folder Structures instead of Subdomain

Rob Jeremy asked on April 17, 2014 11:07

Hi everyone.

Using Kentico 7 here. I found this guide to configure my site to use folders instead of subdomains. http://devnet.kentico.com/docs/7_0rc/devguide/index.html?configuring_multiple_web_sites.htm

This worked very well, except I think I am missing something.

Lets say I have two sites setup on this domain http://www.example.com/site1 http://www.example.com/site2

They both work great.

But what if I wanted to create another site (we could call it site3) to use just the root domain? http://www.example.com I don't think there is any way to accomplish this.

When I add the applications into IIS I am forced to enter an alias for the application, I cannot simply just set it as "/" Also, the actual site I created in IIS(not either of the two applications) is still set to go to a non website root path (C:\empty). When I do change it to the Kentico document root everything fails miserably, so we can leave it at C:\empty

Does anyone have any suggestions on how to handle this scenario? I know there has to be a way to do but I feel like I am just missing something.

Thanks!

Recent Answers


Vilém Jeniš answered on April 22, 2014 06:04

Hi Rob!

Try editing the website's (parent of an application) settings directly. In Basic settings you should be able to set a physical path to what you want to be served as the content. If you set it to an instance of Kentico, that instance will be served as the root application.

0 votesVote for this answer Mark as a Correct answer

Rob Jeremy answered on April 24, 2014 10:58

Hi,

Thank you for your response.

I modified the basic settings of the parent site to point to my Kentico document root (in the link to the guide I posted above, it tells me to set it to C:\empty when using subfolder configuration).

This then will allow the site that I have configured to run at the http://www.example.com to work; however, the other sites that would be configured at http://www.example.com/site1, http://www.example.com/site2, http://www.example.com/site3 all return internal server errors.

The error is: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0x800700b7 Config Error Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ChartImageHandler' Config File \?\C:\inetpub\wwwroot\KenticoCMS7\web.config

192: 193: 194:

I have not modified any of the web.config settings, and is a fresh unmodified install of Kentico.

It almost seems that when IIS is configured to have applications under a Kentico site, the document root needs to be something other than Kentico (hence why the example says to make it go to C:\empty).

Any additional support would be fantastic. Thanks.

0 votesVote for this answer Mark as a Correct answer

Rob Jeremy answered on April 24, 2014 10:59

It looks like the error stuff didn't show up. Posting that here.

193:       <add name="ChartImageHandler" preCondition="integratedMode" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
0 votesVote for this answer Mark as a Correct answer

Vilém Jeniš answered on April 25, 2014 06:28 (last edited on April 25, 2014 06:29)

Hi Rob!

I tried to reproduce what you did and I Indeed got the same error. The problem is, that web.config works hierarchically for some parts and you are adding a handler with the same name into a dictionary, where the name of the handler works as a unique index. What I did to solve this problem is that I removed this line since I don't need to have two handlers registered. The I got a similar error in <system.webServer> <modules > section with an ErrorHandlerModule being registered. The handler is a system handler as well as the previous one, hence I think removing the lines will not cause any problems, since the handlers are already registered thanks to the web.config in the directory above.

My advice is: Remove this lien and the one on which you'll get an error afterwards (should be ~188) and everything will work fine.

Hope this helps,

Vilém

1 votesVote for this answer Mark as a Correct answer

Sofia Khatoon answered on October 20, 2014 18:58

I had this issue when I converted an existing folder into a web application. The newly created web.config at the site level had the handlers for which I had duplicates inside the web applications. I removed the extra entries from the web application to resolve this.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.