I have a situation where I want to use IIS 8 URL Rewrite to point requests for a service from one web application to another. The services are called by an iPhone app, and are hard coded within its code, so for legacy reasons the URL www.myownsite.com/iPhone/myService.asmx must provide the service. However, the main www website is becoming an increasingly complex web application, laborious to deploy (it's actually a Telerik Sitefinity site) and so for ease of deployment of services bug fixes I'd like to move them to a separate site - called services.myownsite.com. Future apps will reference this directly, but I still need to cater for the legacy ones which need the www address.
The two sites sit on the same iis server and share an ip but have different host headers. The service works fine when called directly via the URL
services.myownsite.com/iPhone/myService.asmx
My desire was to use URL Rewrite to point the www. requests to the services. equivalent.
Here's the issue - I can get URL rewrite to work, but only when the rewritten URL is a relative URL. I cannot rewrite to ones containing http: //
This is rather annoying, as I was following the instructions closely in this msdn blog post which suggested that such an approach would be fine http://blogs.msdn.com/b/carlosag/archive/2010/04/02/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr.aspx
Here is an example of what I mean - I tried something simpler to see how it worked. The code below successfully rewrites the URL to another relative URL within the same site, in this case another service
<rule name="Authentication Service" stopProcessing="true">
<match url="iPhone/(.*)" />
<action type="Rewrite" url="/secure/services/anotherservice.asmx" logRewrittenUrl="true" />
</rule>
However, if I try to use an absolute URL - a first step towards being anble to change the URL to another site - it fails. Example below
<rule name="Authentication Service" stopProcessing="true">
<match url="iPhone/(.*)" />
<action type="Rewrite" url="http://www.myownsite.com/secure/services/anotherservice.asmx" logRewrittenUrl="true" />
</rule>
What I'd really like is to have the URL attribute work with values like
http://services.myownsite.com/secure/services/anotherservice.asmx.
I can happily use the regular expression back references to build up rewrite URLs, I'm just tearing my hair out as to why I can't use anything other than a relative URL in the rewrite.
Help please! Thanks