views:

100

answers:

2

I have been testing Umbraco because it's the most popular open source CMS in .NET out there and I was curious. It surprised me that is not possible to run it in a virtual directory.

After working some time with ASP.NET and ASP.NET MVC I noticed that sometimes allowing your application to run in a virtual directory instead as well as in a subdomain can lead to bugs and other annoying problems that could be avoided by simply assuming that the application won't run under that conditions.

Is really that important adding support for virtual directory or nowadays subdomains are so easy to make that is not worth the effort?

+3  A: 

I think it's worth it! The efforts should not be that huge, simply follow these rules:

  • Use relative paths in HTML and CSS
  • Use ~/ to get the application root in server-side controls
  • Use Request.ApplicationPath in code-behind
Vinz
+1. Everything should run in a Virtual Directory. Or the root. Or a Virtual Directory 3 levels deep. It ain't that hard peeps.
Wyatt Barnett
+1 also a good idea to develop and test web sites on IIS in a vdir... that will help catch these types of errors fast
DSO
I agree with you, just wanted to know if someone could give me a good reason not to do it. In the team right now, some people test in a subdomain and others in a vdir.
Marc Climent
+1  A: 

Its a question that probably has to be addressed on a case by case basis - the point about a virtual directory is that it can, or at least should be able to, sit fairly seamlessly as part of a larger site where a sub-domain might not be an appropriate solution.

I can sort of see how, in the case of something like Umbraco - which they would argue should be the site - it might not be a feature worth supporting but in the general case you shouldn't be making assumptions about what the most appropriate system architecture is for your client's site and hence I would want to provide support if feasible.

Murph