2

A client of ours has the following setup under IIS

Sites
 - applications (binds to http://applications.domain.com)
  - app1
  - app2

app1 and app2 are both .NET Single Page Applications (combination of .NET MVC and .NET Web API).

The applications are under the C:\inetpub\applications\ folder and both have been converted to applications. Thus app1 is available under the following URL http://applications.domain.com/app1 and app2 is available under http://applications.domain.com/app2

The problem I'm running into is that all the AJAX routes are relative to the root (/) route and are therefore non existant e.g. http://applications.domain.com/api/products doesn't throws a 404 since the route is actually http://applications.domain.com/app1/api/products.

Is there an IIS setting that will allow me to make this work short of re-writing all my AJAX calls with the prefix? Or is there a different way I can configure this kind of setup under IIS? Thanks.

1 Answers1

0

What you want to do is put both apps in their own virtual directories -- then most of the asp.net calls will get the correct document root and things will be righter with the world.

To do so:

  1. make a fake document root and fake website -- iis7 needs someplace to stash a web.config file and this should be unique to this app. I'd use something like c:\inetpub\applications\deadroot; add an IIS site looking at this folder.
  2. Add a virtual application for app1 pointed at app1's folder inside this site
  3. Add a virtual application for app2 pointed at app2's folder inside this site

Each will then stand on it's head.

Wyatt Barnett
  • 725
  • 5
  • 14
  • Could you please provide more detail on points 1 and 2? I'm not sure what you mean by fake document root and standing a website. For points 3 and 4, do I add these as applications or virtual directories? Thanks. – Bart Jedrocha Mar 25 '14 at 19:44
  • Fleshed it out a bit but you want apps not virtual directories here. – Wyatt Barnett Mar 25 '14 at 20:20