I have a WCF Web Service hosted inside a ASP.NET 4 environment (IIS 7.5 on Windows 7), and I would like to use URL Rewriting / Redirection. The reason I need to do this is because I can't change some mobile device code to just insert the parameter.
Here is the URL I want:
http://server.test.com/VirtualDirectory/theOrganization/RequestService.svc/REST/GetIssueTypes
The real URL is:
Notice how I want to remove theOrganization and appended it to the Query string for redirection.
<rule name="test" stopProcessing="true">
<match url="(.+\.?)/(.+)/RequestService.svc/(.+)" />
<action type="Redirect" url="{R:1}/RequestService.svc/{R:3}?organization={R:2}"
redirectType="Permanent" />
</rule>
I know it's a little odd of a rule to write. Thinks i have my regular expression correct for matching. I run the expression in the URL Rewrite tester in IIS Manager, and it seems like it's matching what I want. Also, I do have IIS URL Rewrite installed, and I made a simple rule up and it worked.
However, when I try it using a browser, it failed to redirect and results in a 404. I was hoping a IIS Rewrite expert could chime in, as I am fairly new at it.
Thanks!