Rewrite map should store the complete URL strings, not part of them or patterns.
Thus, you need to use,
<configuration>
<system.webServer>
<rewrite>
<rewriteMaps>
<rewriteMap name="StaticRewrites">
<add key="/url_rw/mainpage" value="/url_rw/index.aspx" />
</rewriteMap>
</rewriteMaps>
<rules>
<rule name="Rewrite Rule 1 for StaticRewrites" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{StaticRewrites:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" appendQueryString="False"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>