3

I've a couple of sites configured under a sub-domain and all appears to work well (www.dx1.main.co.uk, www.dx2.main.co.uk)

Now we require a site to render from a sub-directory of the main (none-DXA) website (www.main.co.uk/dxa-collection/dx3, www.main.co.uk/dxa-collection/dx4) (and in the future possibly www.main.co.uk/dx5).

So within IIS we have the dxa-collection site running as an application underneath a separate site which enables us to use load balancing correctly.

All configured OK is IIS (it seems) but noted that

  1. assets such as CSS files, JS file and images are loaded from the root, ie: www.main.co.uk/BinaryData rather than the correct location which is www.main.co.uk/dxa-collection/dxa?/BinaryData
  2. the top level navigation is using the wrong directory as well, in this case www.main.co.uk/dxa-collection rather than www.main.co.uk/dxa-collection/dxa4

Using 2013 SP1 HR1, DXA 1. will post excerpts from web.config, cd_storage and cd-link as soon as I get access.

0

Actually this URL scheme doesn't work with OOTB DXA code(AFAIK), i had to modified the code to support this type of scheme.

some of the code line, which i changed in earlier version File: Sdl.Web.Mvc.Statics.StaticContentModule Line: 108:

 string staticsRootUrl = SiteConfiguration.GetLocalStaticsUrl(localization.LocalizationId);
string matchPath = request.ApplicationPath + "/" staticsRootUrl;
urlPath = urlPath.StartsWith(matchPath) ? urlPath.Substring(matchPath.Length) : urlPath;

also at pathRewrite you may have to modify the code.

As DXA resolve the binary URLs to the main Website root rather than your sub-site root directory.

just debug near above lines, you will understand it. This is just food for thought, i actually changed in 1.01, lots of code has been refactored in subsequent releases.

  • I've had a personal comment from a colleague also regarding his need to also code specifically around this type of scenario (albeit a simplified one) also. I'll update the post when I've had a chance to review your comments more closely Raj - thanks – Dylan .. Mark Saunders Feb 25 '16 at 11:07
  • its simple one but need to workout all scenarios main site and sub sites. only changes in modules will be required. i would have shared my code, but that would be irrelevant as lots of files has changed since 1.01 – Raj Kumar Feb 25 '16 at 11:28
  • The solution (in this case) was to add bespoke code to manage the different URL structures/base site URLS. In future projects / versions of DXA we will kick-off the project with a request to confirm exactly what can be supported OOTB in terms of 'different configurations' so it's clear what work is required - up front. If we get this opportunity it will make a good blog I'm sure. – Dylan .. Mark Saunders Mar 3 '16 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.