Ok, I figured it out with backreferences. Here is the rule:

                <rule name="Services" stopProcessing="true">
                    <match url="([0-9A-Za-z]+)/([v]{1}[0-9]+.[0-9]+)/
(.*)" />
                    <action type="Rewrite" url="http://{R:1}-{R:2}/{R:
3}.svc" logRewrittenUrl="true" />
                </rule>

Ciao!

rbr

On Aug 19, 4:39 pm, rbr <[email protected]> wrote:
> Hello,
>
> I am new to the IIS rewrite rule and have, what I believe, is a fairly
> easy rule that I need to implement. I am creating a proxy site that
> will redirect WCF requests. The request address will have a version
> number in the path to indicate what version of the service to call. We
> had a solution that required fairly rudimentary rewriting but have
> learned we need to take this proxy approach. Being new to this module
> and far from a regex expert, I was hoping to get some help.
>
> A sample scenario would be a request coming in with an address like:
>
> http://www.mywebsite.com:8080/ParentSite/v1.0/SampleSvc
>
> And I need to take this request and redirect it to an endpoint like
> this:
>
> http://ParentSite-v1.0/SampleSvc.svc
>
> So, I need to extract the "ParentSite" and "v1.0" to determine the
> redirect action path. Is this possible? Can you store regex pattern
> match results and reuse them?
>
> Any help is very greatly appreciated.
>
> TIA
>
> rbr

Reply via email to