Hosting Umbraco on a Virtual Directory
# help-with-umbraco
o
Hi all, We have a client site that currently sits on a virtual directory e.g.
ourclient.com/news
, where
/news
is our Umbraco site. On the current v8 site, we installed Umbraco itself in a
/news/
folder on the server, and everything worked ok, but that doesn't appear to be supported anymore in v13. I found two GitHub issues relating to this, where Umbraco HQ said they don't plan on supporting this scenario and suggest using a reverse proxy: https://github.com/umbraco/Umbraco-CMS/issues/11891#issuecomment-1570423375 https://github.com/umbraco/Umbraco-CMS/pull/13592#issuecomment-1570421802 but has anyone actually attempted this with a v10+ site? if so, where there any gotchas or sticking points?
c
Even in framework days I nearly always found virtual directories caused more issues than they solved, so I'd never noticed this was even supported in v8 let alone that support had been dropped from v9. Though if I'm following it right, and from some playing about with a v13 site on my IIS server here, it isn't possible to get it working as a Virtual Directory, but Microsoft do say VDs aren't supported in .net Core and you should use Sub Apps by doing 'convert to application' on a physical subfolder instead. Doing it as a sub application instead, it does seem its possible to get the frontend of a simple v13 site working and routing pages correctly, as long as you have the culture on the root node setup to the first level folder url too. However back office doesn't work as it always looks to root of the domain for everything. That said if the main issue preventing it working fully seems to be a lot of the Umbraco backoffice calls always look back to the root of the domain rather than the subfolder, causing subsequent problems with finding back office assets, then I'd have thought that same issue would exist even if you were reverse proxying it from a subfolder URL instead. You'd be able to reverse proxy frontend URLs from the folder fine and handle the generation of correct URLs yourself in the FE code. But you'd still need to have the back office side running on a real other domain so it could be found at a root of 'something'
s
how about redirecting it all to news.domain.com ?
o
Cheers Terence! Interesting that Microsoft says that .net core doesn't support this ootb anymore 😦
Client is unmovable in their requirements for it to live on
/news
unfortunately
s
We don't support vdirs since v9 any more (as you can host on different server types now), so a reverse proxy would be your only way to go. But.. yeah.. no idea how to set that up. And as usual, clients can be movable, with the right incentives and explanation 😅
Alternatively, whatever system you use now where "/news" is embedded, you can use the Content Delivery API to present the data in that system, pulling from Umbraco. Maybe...
b
+1 for @Sebastiaan suggestion for the content delivery api! I just tackled this...I took a stand alone Umbraco v12 site and ported it to be a v14 Content Delivery API with a separate .NET Core MVC frontend site. But, that process would require that you're able to run a .NET Core MVC site in the Virtual Director, and that bit I'm not sure about one way or the other. I haven't done a Virtual Dir in more than 15 years probably. Good luck @Owain Jones!
o
Yea that's fair, I appreciate it's a rather niche requirement, and tbh, a headless solution would've defo suited it much better, but alas, this was originally built on v7 😬 Thankfully I'm not the one tackling this, another Team is, I'll update here if they manage to somehow get it working, or mange to convince their client to change to a subdomain
Thanks again for all of your input! 😄
101 Views