I have developed two projects in VS 2012, an MVC 4 application and an MVC WebAPI, and installed them into IIS. I am testing the ability to rewrite requests from:
http://web.testsite.com/webapi/customers/5
to
http://api.testsite.com/api/customers/5
If I remove the ExtentionlessUrlHandler-Integrated-4.0 from my web.config for web.testsite.com, then I can make requests to api.testsite.com, however, I then get a 403.14 - Forbidden as it wants to list the contents of the directory. If I put the handler back, then I get a 404 for the call to api.testsite.com rewrite.
Here is my rule:
<rule name="webapi" stopProcessing =" true" >
< match url =" webapi/(.*)" />
< conditions>
< add input =" {HTTP_HOST}" pattern="web(\.testsite\.com)$" />
</ conditions>
< action type =" Rewrite" url= "http://api{C:1}/api/{R:1} " />
</ rule>
I appears that something with the ExtentionlessUrlHandler is causing this issue and don't know how to resolve it. Any help is appreciated and I am open to other ways of handling this. I'm hoping there is some easy way to configure this to resolve the problem.
Thanks,
Jesse