Issues with using Umbraco in Sub-folder / Virtual Directory?
Hi all,
I already know that Umbraco doesn't support virtual directories - but does anyone know what happens if you do - or at least try to?
Reason I ask is that I am redeveloping an existing website for a client - and the prerequisite is that the base URL doesn't change, which is in this format:
Set the hostname of the the root content (homepage) node to "www.domain.com/section/website"
Set "useDomainPrefixes" (in umbracoSettings.config) to true
In IIS, point the "/section/website/" to the Umbraco install
The thinking behind this is that when you go to "www.domain.com/section/website" - you will get the content pages, and NiceUrl will resolve the links with full URL (I need to double-check that though).
So in a nutshell, I want the front-end to run from a sub-folder / virtual-directory ... and the back-office can be accessed from a root domain (or sub-domain, whatever).
A lot of the Umbraco internals (particularly Data Types IIRC) do stuff like this: "../bin/" + AssemblyName + ".dll". I think there's also some "/bin" stuff somewhere.
It is currently being looked into though, Per is working on supporting virtual directories (check out codeplex check ins).
@Benjamin - sure I'll send you the App_Code editor code ... DM me your email address.
Going back to the original topic ... I'm getting pretty desperate on finding a solution.
Is there anyway I can have the front-end on a sub-folder ... and for the back-end - I don't care where it is ... domain/sub-domain, it's all good. The key part is the front-end URL (sub-folder).
1. Static version of the site. On the publish event, create a static version of the page and copy it to the sub-folder. Maybe using/extending Darren Ferguson's old Export to HTML plugin - or develop code to hook into the WinHTTrack command line?
2. Write a small proxy app - that handles the URLs from the sub-folder ... calling Umbraco /base (or other web-service methods) - and replace the root URL with the sub-folder (for all the hyperlinks/scripts/images/etc).
3. ISAPI_Rewrite / htaccess ... we do have a license for this - and have tried to use the RewriteProxy - but ran into all sorts of problems with /WebResource.axd, etc.
4. ... [insert crazy hairbrained scheme here!]
Am I completely off track here, missing something completely obvious? Any feedback all at is appreciated!
But what does it mean to say the urls have to work? Do you mean you could 301 redirect all the old urls to new urls without the /section/website/ portion of the url? All old links people had bookmarked, were embedded in the pages, or saved in search engines would continue to work just fine... but you wouldn't need to handle the nearly incompatible url format with umbraco.
A serious 301 redirect mechanism (rewriting urls; not-found handler; or other) would be the best of all worlds, I think.
Another option would be load umbraco into the root of the site and create a 'section' and 'website' node in the content tree, below which all your content exists. Umbraco would handle the urls flawlessly. If you needed to allow other appliations to work in the domain (say, /section2 or /section/website2) you could add those to the reserved urls and reserved path sections of the web.config file.
Thanks for your ideas Doug, very much appreciated.
Due to my NDA/contract, I can't explain the importance of the root domain (that the sub-folder sits under), but let's say it's a pretty big brand - and I can't make any changes to it.
We are now talking about moving the site to it's own domain ... which would resolve this issue completely! Then we'll do as you suggested with the 302 redirects. (IMO, this is the most sensible solution).
When v4.5 was released, I did test it out on a Virtual Directory - and it worked great - for my testing purposes. I haven't actually used it on a live/production website yet. (The website in my original post went with a sub-domain option).
My concern about using Virtual Directories is package support - as I know a lot make an assumption about being in the web-root ... but I guess until someone starts using Virtual Directories, we'll never know!
I've installed 4.5.2 in a virtual directory for a very small site. I did run into one (fairly) major issue, there is a bug that prevents users from adding images in the RTE. See http://umbraco.codeplex.com/workitem/29196
Other than that, everything seemed to work fine, but again it was a very small site
But now It seems that every relative link points to the root. Is ther any option to change the root of the umbraco installation so it root will be the virtual directory?
However, to make it work for my existing content, I did a search and replace for the links int the media library in the database. I also attempted to do this for the documents, but it only seemed to work for some of the links. The rest of them, I corrected manually.
Issues with using Umbraco in Sub-folder / Virtual Directory?
Hi all,
I already know that Umbraco doesn't support virtual directories - but does anyone know what happens if you do - or at least try to?
Reason I ask is that I am redeveloping an existing website for a client - and the prerequisite is that the base URL doesn't change, which is in this format:
http://www.domain.com/section/website/
(Obviously, I've not used the real domain/folder names - doh!)
Now, they want to use Umbraco (and why not), but I'm trying to figure out how to best handle this.
So far, my thinking is that I will do the following:
The thinking behind this is that when you go to "www.domain.com/section/website" - you will get the content pages, and NiceUrl will resolve the links with full URL (I need to double-check that though).
So in a nutshell, I want the front-end to run from a sub-folder / virtual-directory ... and the back-office can be accessed from a root domain (or sub-domain, whatever).
Can anyone see any fatal flaws in this idea?
Many thanks, Lee.
A lot of the Umbraco internals (particularly Data Types IIRC) do stuff like this: "../bin/" + AssemblyName + ".dll". I think there's also some "/bin" stuff somewhere.
It is currently being looked into though, Per is working on supporting virtual directories (check out codeplex check ins).
Thanks Aaron, I thought as much. Really looking forward to v4.1!
In the meantime, we've got ISAPI_Rewrite at our disposal... along with a lot of jiggery-pokery, I'm sure we'll figure out a workable solution!
Cheers, Lee.
Yeah Per's goal is to get it into 4.1, as it'll also help with Mono support, which would be totally awesome :D
Hella yeah! Along with Benjamin's Medium Trust patches, the playing field for Umbraco has exploded!
Exciting times ahead for Umbraco devs!
Next up, iPhone version :P
Please give some more details
vijay
There's already a module that produces iPhone-compatible pages... here.
@Lee Thankyou :-) DM me on Twitter so I can grab that App_Code editor from you at some stage as well, cause that's a must-have on my radar.
@Benjamin - sure I'll send you the App_Code editor code ... DM me your email address.
Going back to the original topic ... I'm getting pretty desperate on finding a solution.
Is there anyway I can have the front-end on a sub-folder ... and for the back-end - I don't care where it is ... domain/sub-domain, it's all good. The key part is the front-end URL (sub-folder).
Thanks, Lee.
Thoughts so far ...
1. Static version of the site. On the publish event, create a static version of the page and copy it to the sub-folder. Maybe using/extending Darren Ferguson's old Export to HTML plugin - or develop code to hook into the WinHTTrack command line?
2. Write a small proxy app - that handles the URLs from the sub-folder ... calling Umbraco /base (or other web-service methods) - and replace the root URL with the sub-folder (for all the hyperlinks/scripts/images/etc).
3. ISAPI_Rewrite / htaccess ... we do have a license for this - and have tried to use the RewriteProxy - but ran into all sorts of problems with /WebResource.axd, etc.
4. ... [insert crazy hairbrained scheme here!]
Am I completely off track here, missing something completely obvious? Any feedback all at is appreciated!
Thanks, Lee.
I know, I know, you said... "the prerequisite is that the base URL doesn't change, which is in this format: http://www.domain.com/section/website/"
But what does it mean to say the urls have to work? Do you mean you could 301 redirect all the old urls to new urls without the /section/website/ portion of the url? All old links people had bookmarked, were embedded in the pages, or saved in search engines would continue to work just fine... but you wouldn't need to handle the nearly incompatible url format with umbraco.
A serious 301 redirect mechanism (rewriting urls; not-found handler; or other) would be the best of all worlds, I think.
Another option would be load umbraco into the root of the site and create a 'section' and 'website' node in the content tree, below which all your content exists. Umbraco would handle the urls flawlessly. If you needed to allow other appliations to work in the domain (say, /section2 or /section/website2) you could add those to the reserved urls and reserved path sections of the web.config file.
What do you think? Either of these workable?
cheers,
doug.
Thanks for your ideas Doug, very much appreciated.
Due to my NDA/contract, I can't explain the importance of the root domain (that the sub-folder sits under), but let's say it's a pretty big brand - and I can't make any changes to it.
We are now talking about moving the site to it's own domain ... which would resolve this issue completely! Then we'll do as you suggested with the 302 redirects. (IMO, this is the most sensible solution).
Thanks again!
Cheers, Lee.
Hi All,
Can anyone let me know if Virtual Directory support is now available?
I also have a client who would like to run multiple sub sites under virtual directories, rather than having sub-domains.
E.g.:
http://www.domain.com/firstsite
http://www.domain.com/secondsite
Cheers,
Chris
Hi Chris,
When v4.5 was released, I did test it out on a Virtual Directory - and it worked great - for my testing purposes. I haven't actually used it on a live/production website yet. (The website in my original post went with a sub-domain option).
My concern about using Virtual Directories is package support - as I know a lot make an assumption about being in the web-root ... but I guess until someone starts using Virtual Directories, we'll never know!
Cheers, Lee.
I've installed 4.5.2 in a virtual directory for a very small site. I did run into one (fairly) major issue, there is a bug that prevents users from adding images in the RTE. See http://umbraco.codeplex.com/workitem/29196
Other than that, everything seemed to work fine, but again it was a very small site
Hi!
Has there been any new developments on this?
Has support for running umbraco in a subfolder or virtual directory been implemented?
I have got two umbraco 6 installations that I need to move from
www.domain1.com and www.domain2.com
to www.newdomain.com/domain1 and www.newdomain.com/domain2
Kindly,
Trond
Hi,
It would be usefull for me two if any anyone know on a progress with using umbraco on a subfolder.
I'm trying to host 3 umbraco installation under 1 domain. One on the main folder and 2 on 2 subfolder.
The goal is to save the need of 3 ssls, dedicated IP and so...
Anyone?
Hi,
For me, the answer was here:
http://our.umbraco.org/documentation/Installation/install-umbraco-manually
"Using a virtual directory"
Hey thanks! It did the trick for me too!
But now It seems that every relative link points to the root. Is ther any option to change the root of the umbraco installation so it root will be the virtual directory?
You can have a look at the section "ResolveUrlsFromTextString" in http://our.umbraco.org/documentation/Using-Umbraco/Config-files/umbracoSettings/ ;
However, to make it work for my existing content, I did a search and replace for the links int the media library in the database. I also attempted to do this for the documents, but it only seemed to work for some of the links. The rest of them, I corrected manually.
Hope this helps.
is working on a reply...