Our client has an IIS configuration wherein they have a main site and a child site in a virtual directory beneath the main site. The Umbraco instance needs to be installed in the child site.
Our current problem is that certain Umbraco pages do not work properly in the backoffice in this configuration. For instance, preview doesn't work...unless we change certain paths in /umbraco/preview/index.html to use .. instead of /umbraco. We are now finding that there are more pages that suffer from this problem (/umbraco/settings/Views/EditView.aspx, for instance).
Is there some setting we can change that will allow Umbraco to resolve paths properly without having to modify every Umbraco ASPX page (which would be a non-starter, as that would be required to be done every time we update)? This is a show-stopping problem for us.
I have two projects on this machine, one 7.3 which has absolute URLs in those files you mentioned and 7.3.5 which uses relative URLs.
I'm not sure about the rest of the application though. In my experience virtual directories are trouble and are to be avoided wherever possible. If you're able to convince your client of the virtues of sub-domains you'll save yourself (and your client) a lot of headaches like this one.
We also had client with this setup we had some fun and games with packages failing in some instances we have had to mess with package source leblender being one of them.
I have configured an umbraco 7.3.1 website in IIS successfully and is working fine. Now, i have a requirement to add this Umbraco 7.3.1 Website to be inside a virtual directory converted to application in another parent website (Umbraco 7.3.1). But there is an issue while running that 7.3.1 site as subsite.
When i tried to access this site as for example like, Umbraco7.3.1site/Umbraco7.3.1Subsite. We are getting the follwing error.
Please provide your solutions for it, i have wasted almost a week over it.
My route for the 7.3.1 site is: "D:\delete me\UmbNewInstances\Parent"
Route for the 7.3.1 subsite is: "D:\delete me\UmbNewInstances\Child"
Let me know if someone wants any input from my side.
Found a Solution that works kinda well in certain instances:
Introduction
There are several instances where you may find you want to, or need to install multiple Umbraco sites on a single domain and for some reason cannot accomplish this with subdomains which would be the easiest solution. As virtual directories are not an option since Umbraco does not support this, we have to come up with a different solution. To this end one method that works is URL rewrites.
Goal
The final outcome is to show how to run two ( or more ) Umbraco sites and children of a single parent site.
Application Request Routing version 1.0 or version 2.0 installed
Implementation
First Configure all three sites as such:
my.umbraco.site
Site2.my.umbraco.site – Turn Off gzip Compression
Site3.my.umbraco.site – Turn Off gzip Compression
Enabling Reverse Proxy functionality
Reverse Proxy functionality is disabled by default, so you must begin by enabling it.
Open IIS Manager
Select a server node in the tree view on the left hand side and then click on the "Application Request Routing" feature:
Check the "Enable Proxy" check box. Leave the default values for all the other settings on this page:
Go To my.umbraco.site -> URL Rewrite -> (link on the left “View Server Variables”)
Add 2 variables:
HTTPACCEPTENCODING
-HTTPXORIGINALACCEPTENCODING
Web.config my.umbraco.site
First we need to tell out Base Umbraco install that we have two folders where it must not intercept and block traffic to by updating umbracoReservedPaths
Now comes the fun part, setting up the rewrite and reverse proxy rules, this is where the magic happens. The URL rewrites will be places in the top of the
First we are going to add rules to “Proxy” the requests from the Umbraco site to one of the sub sites.
This on it’s own will give you a basic workable site where all the links and css are broken, but your basic HTML is served. From here you can create a site that functions well enough if you develop it correctly, if however you want to take an existing site and do this, then you require a few further steps.
There are three major sections we need to look at, namely CSS, HTML, and Redirects which are all fixed via outbound rules. The next step is to define these section.
Now that our sections are defined we can create Rules for each of them.
HTML
This rewrites the HTML searching for tags matched in the filter tags section and matches anything between quote tags that starts with “/” and prepends it with the corresponding matched pattern from the URL being rewritten.
The CSS in this case references Media in both the media library and content section of the site, this should be updated to match your configuration of where images are referred to from your css.
I know this thread is a bit old but I am in the same situation on Umbraco8 and tried your solution.
It's working great except for one thing :
on UmbracoSite2 or 3, images with a query string in the url don't appear anymore (for example https://my.umbraco.site/Site2/media/4cyhe4f4/1664.png?height=30).
But It works if I remove the parameters after ?
I suspect that the rewriting prevents ImageProcessor to do his job.
Does anybody have any idea why and how I could fix that ?
Umbraco in child virtual directory
Our client has an IIS configuration wherein they have a main site and a child site in a virtual directory beneath the main site. The Umbraco instance needs to be installed in the child site.
Our current problem is that certain Umbraco pages do not work properly in the backoffice in this configuration. For instance, preview doesn't work...unless we change certain paths in /umbraco/preview/index.html to use .. instead of /umbraco. We are now finding that there are more pages that suffer from this problem (/umbraco/settings/Views/EditView.aspx, for instance).
Is there some setting we can change that will allow Umbraco to resolve paths properly without having to modify every Umbraco ASPX page (which would be a non-starter, as that would be required to be done every time we update)? This is a show-stopping problem for us.
This may have been fixed as of 7.3.2. Take a look at http://issues.umbraco.org/issue/U4-1117
I have two projects on this machine, one 7.3 which has absolute URLs in those files you mentioned and 7.3.5 which uses relative URLs.
I'm not sure about the rest of the application though. In my experience virtual directories are trouble and are to be avoided wherever possible. If you're able to convince your client of the virtues of sub-domains you'll save yourself (and your client) a lot of headaches like this one.
Thanks for the advice, Jason. Can anyone else out there confirm if 7.3.2 fixes this issue?
Tim,
We also had client with this setup we had some fun and games with packages failing in some instances we have had to mess with package source leblender being one of them.
Regards
Ismail
I upgraded to 7.3.6 and this issue has now been fixed.
Hi Guys,
Is there any way to fix the following for 7.3.1?
I have configured an umbraco 7.3.1 website in IIS successfully and is working fine. Now, i have a requirement to add this Umbraco 7.3.1 Website to be inside a virtual directory converted to application in another parent website (Umbraco 7.3.1). But there is an issue while running that 7.3.1 site as subsite. When i tried to access this site as for example like, Umbraco7.3.1site/Umbraco7.3.1Subsite. We are getting the follwing error.
Please provide your solutions for it, i have wasted almost a week over it.
My route for the 7.3.1 site is: "D:\delete me\UmbNewInstances\Parent" Route for the 7.3.1 subsite is: "D:\delete me\UmbNewInstances\Child"
Let me know if someone wants any input from my side.
I'm having the same issue, trying to load an Umbraco site inside a virtual directory of another Umbraco site, did you ever manage to get it right?
Found this : https://our.umbraco.org/forum/using-umbraco-and-getting-started/87556-invalid-key-value-live-models-builder#comment-278626
Found a Solution that works kinda well in certain instances:
Introduction
There are several instances where you may find you want to, or need to install multiple Umbraco sites on a single domain and for some reason cannot accomplish this with subdomains which would be the easiest solution. As virtual directories are not an option since Umbraco does not support this, we have to come up with a different solution. To this end one method that works is URL rewrites.
Goal
The final outcome is to show how to run two ( or more ) Umbraco sites and children of a single parent site.
Example layout:
http://my.umbraco.site/
http://my.umbraco.site/UmbracoSite2
http://my.umbraco.site/UmbracoSite3
Prerequisites
To run this setup, you must have the following:
IIS 7 or above with ASP.NET role service enabled.
URL Rewrite Module installed version 2.0 or above
Application Request Routing version 1.0 or version 2.0 installed
Implementation
First Configure all three sites as such:
my.umbraco.site
Site2.my.umbraco.site – Turn Off gzip Compression
Site3.my.umbraco.site – Turn Off gzip Compression
Enabling Reverse Proxy functionality
Reverse Proxy functionality is disabled by default, so you must begin by enabling it.
Open IIS Manager
Select a server node in the tree view on the left hand side and then click on the "Application Request Routing" feature:
Check the "Enable Proxy" check box. Leave the default values for all the other settings on this page:
Go To my.umbraco.site -> URL Rewrite -> (link on the left “View Server Variables”)
Add 2 variables:
Web.config my.umbraco.site
First we need to tell out Base Umbraco install that we have two folders where it must not intercept and block traffic to by updating umbracoReservedPaths
Now comes the fun part, setting up the rewrite and reverse proxy rules, this is where the magic happens. The URL rewrites will be places in the top of the
First we are going to add rules to “Proxy” the requests from the Umbraco site to one of the sub sites.
This on it’s own will give you a basic workable site where all the links and css are broken, but your basic HTML is served. From here you can create a site that functions well enough if you develop it correctly, if however you want to take an existing site and do this, then you require a few further steps.
There are three major sections we need to look at, namely CSS, HTML, and Redirects which are all fixed via outbound rules. The next step is to define these section.
Now that our sections are defined we can create Rules for each of them.
HTML
This rewrites the HTML searching for tags matched in the filter tags section and matches anything between quote tags that starts with “/” and prepends it with the corresponding matched pattern from the URL being rewritten.
Redirects
The below rule intercepts response redirects ( HTTP Response Code 3?? Eg. 301 ) and prepends the matched URL to the response URL.
CSS
The CSS in this case references Media in both the media library and content section of the site, this should be updated to match your configuration of where images are referred to from your css.
Once you are done your Rewrite section in system.webServer should look something like this:
Rewrite action Key:
{C:1} - Condition Match Group 1
{R:1} - Rule Match Group 1
Javascript
Javascript can be handled in a similar fashion by adding a preCondition and similar rules
OR
in the javascript itself as such
var BasePath = "UmbracoSite2/"; if (~$(location).attr('href').indexOf("Site2.my.umbraco.site")) {
BasePath = "";
}
Notes
While this covers the majority of the sites there will always be minor changes that will be required with your individual site.
Hi Jonathan,
I know this thread is a bit old but I am in the same situation on Umbraco8 and tried your solution. It's working great except for one thing : on UmbracoSite2 or 3, images with a query string in the url don't appear anymore (for example https://my.umbraco.site/Site2/media/4cyhe4f4/1664.png?height=30). But It works if I remove the parameters after ? I suspect that the rewriting prevents ImageProcessor to do his job.
Does anybody have any idea why and how I could fix that ?
Thanks in advance, Arnaud
is working on a reply...