I have this block in my web.config
:
<rewrite>
<rules>
<rule name="Remove Trailing Slash" stopProcessing="false">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}" />
</rule>
<rule name="Angular UI Router - HTML5 Mode" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{URL}" pattern="/api/" negate="true" />
</conditions>
<action type="Rewrite" url="/app/" />
</rule>
</rules>
</rewrite>
In an Azure release pipeline I'm using the MagicChunks tool to transform the web.config
to change the second action
elements' url
attribute to "/"
but it is failing. The transform I have is:
{
"rewrite/rules/rule/action[@type='Rewrite' and @url='/app/']/@url": "/"
}
The error it throws up is:
System.ArgumentException:***There***is***empty***items***in***the***path.
How can I target an attribute to be transformed when it is not the attribute(s) being used as the target path?