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?