I am attempting to use IIS to rewrite requests from my ASP.net MVC 4 application to my ASP.net MVC 4 WebApi. From the client, I am using ajax to make calls back to the server which I would then like the server to rewrite the request to point to the webapi site. This should solve any cross domain issues if I can get it to work.
I have installed URL rewrite, Web Farm Framework, ARR, and External Cache per this article: http://blogs.iis.net/wonyoo/archive/2011/04/20/how-to-install-application-request-routing-arr-2-5-without-web-platform-installer-webpi.aspx
In IIS->Application Request Routing->Server Proxy Settings" and checked the box that says "Enable proxy".
My rewrite rule looks like:
<rule name="webapi" stopProcessing =" true" >
< match url =" webapi/(.*)" />
< conditions>
< add input =" {HTTP_HOST}" pattern="web(\.mytest\.com)$" />
</ conditions>
< action type =" Rewrite" url= "http://api{C:1}/api/{R:1} " />
</ rule>
What is really curious if I remove the ExtensionlessUrlHandlers in the web.config of my MVC site, then my rewrite works perfectly. Unfortunately, the MVC routing breaks and my site no longer works. If put the ExtensionlessUrlHandlers back in, the rewrite fails and the MVC routing works as expected.
Is there a simple way to solve this issue?