I'm using DD4T.Web.Binaries.BinaryDistributionModule
to serve binaries from the broker database.
I have multiple instances of a single DD4T web app, each hosted as a separate virtual application under a master physical IIS site, where a Publication maps to a virtual app (as each locale will exist under a subdirectory; e.g. "mysite.com/fr"). My Publication config looks like this (for example):
Publication Path: \corporate
Publication URL: /
Images Path: \corporate\Images
Images URL: /corporate/Images
This all works fine for serving up content, linking etc. However, all requests for images fail, with the following error:
The virtual path '/BinaryData/corporate/Images/x.png' maps to another application, which is not allowed.
Looking at the source for the binary distribution module, it seems as though it is explicitly using the physical application path when constructing the image URL:
string realPath = request.PhysicalApplicationPath +
"BinaryData" + request.Path.Replace("/", "\\");
Obviously, this is no good, as the resulting URL no longer maps to the "corporate" application. I can't remove "corporate" from the "Images" path, however, as then the request won't reach my DD4T app at all.
Has anybody come up against this before? Is there some configuration I'm missing?