Installation and deployment
Version 7.x > Installation and deployment > Kentico app in sub folder and IIS URLRewrite? View modes: 
User avatar
Member
Member
charleswesley-gmail - 9/11/2013 2:10:25 PM
   
Kentico app in sub folder and IIS URLRewrite?
I am hosting a site on winhost and I am using IIS URLRewrite to allow for sub folders on the host to be mapped to sub domains.

i.e.

/root/
/root/myapp/
/root/KenticoCMS/

with IIS URL Rewrite rules in the root web.config to route requests for 'mydomain.com' to route to /root/KenticoCMS/ and requests for "myapp.mydomain.com' to route to /root/myapp/

Currently when I disable the rewrite, mydomain.com/KenticoCMS/ comes up fine.

However when I enable to rewrite, I get an exception:

[ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +10698899
CMS.URLRewritingEngine.URLRewriter.CheckPermissions(String siteName, PageInfo pi, Boolean excludeSystem) +235
CMSAppBase.CheckSecurity() +775
CMSAppBase.CMSAcquireRequestState(Object sender, EventArgs e) +606
CMS.CMSHelper.CMSApplicationModule.app_AcquireRequestState(Object sender, EventArgs e) +22
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Anyone have any suggestions on how to configure the site so that it can work in this setup?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/12/2013 8:29:07 AM
   
RE:Kentico app in sub folder and IIS URLRewrite?
Hi,

What is the exact setup in the IIS? Whjere are the web.config files and how are they nested?

Have you tried configuring nested web sites? Or, you want to integrate with existing .Net app?

Best regards,
Juraj Ondrus

User avatar
Member
Member
charleswesley-gmail - 9/12/2013 11:35:24 AM
   
RE:Kentico app in sub folder and IIS URLRewrite?
I am using WinHost, so the IIS settings are standard to what they allow. The sub folders are applications I believe.

What I am trying to do is map sub-domains to a folder as per this blog post.

Essentially by using IIS URLRewrite you can map any domain or subdomain to a sub folder of the site's root without having to have the name of the sub folder in the URL.

I.e. to avoid myapp.mydomain.com/myapp/

I would like to run an instance of Kentico along with a separate application.

The rewriting of URLs works for the application in the /myapp/ directory.

When I ran through the Kentico web installer wizard the URL was www.mydomain.com/KenticoCMS/

I suspect from the exception that there is a conflict between the URL rewriting in the Kentico app (it is expecting /KenticoCMS/).

I'm thinking either I need to somehow modify the CMS to have it ignore that portion of the URL, or I should re-install in the root, then move it to the sub folder and put my root rewrite rules back in place?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/16/2013 2:59:43 AM
   
RE:Kentico app in sub folder and IIS URLRewrite?
Hi,

Thank you for the details. We have identified a possible bug in the CMS. We are sorry for the inconvenience. It will be fixed in the hotfix no. 54 (will be released on Friday). Please, try applying the hotfix to see if it will fix the issue.

Best regards,
Juraj Ondrus

User avatar
Member
Member
charleswesley-gmail - 9/16/2013 11:12:18 AM
   
RE:Kentico app in sub folder and IIS URLRewrite?
Thank you very much, I'm very impressed with how responsive your team is and that a bug fix will be available so quickly. Other commercial .NET CMS platforms I have used in the past have had bugs I repeatedly reported remain unfixed for literally years.

I will apply the hotfix when it is available and report back -- thank you.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/23/2013 3:05:50 AM
   
RE:Kentico app in sub folder and IIS URLRewrite?
Hi,

Did the hotfix help?
I noticed you posted this question on stackoverflow too - in case the hotfix helped, I would like to update it there too.

Thank you.

Best regards,
Juraj Ondrus