1

I need to rewrite a url like /fl-1/page/name.aspx

to

/fl-1/pages/name.aspx

Where "1" and "name" are variable. I'm trying with this expression

  <rule name="D17" patternSyntax="ECMAScript">
    <match url="(.*)" />
    <conditions>
      <add input="{REQUEST_URI}" pattern="^/fl-([0-9]+)/page/([^/]+)$" />
    </conditions>
    <action type="Redirect" url="/fl-{R:1}/pages/{R:2}" redirectType="Permanent"/>
  </rule>

but when trying this I get this error: Error HTTP 500.50 - URL Rewrite Module Error. Expression "/fl-{R:1}/pages/{R:2}" cannot be expanded.

EDIT: when testing the url /fl-1/page/name.aspx with this regex ^/fl-([0-9]+)/page/([^/]+)$ I get two matches so in theory R1 and R2 should be available here.

Any ideas?

vmasanas
  • 503
  • 1
  • 7
  • 18
  • I'm testing my regex here http://www.regexlib.com/RETester.aspx using the sample url I provided and I get 2 matches, not one as noted on the other question you referenced. I don't think it's the same problem. – vmasanas Jun 14 '17 at 10:59

0 Answers0