This should do it:
<rewrite>
<rewriteMaps>
<rewriteMap name="ShortURLs">
<add key="terms" value="/en-us/terms-and-conditions/"/>
<add key="privacy" value="/en-us/privacy-and-cookies/"/>
<add key="buy" value="/en-us/where-to-buy/"/>
</rewriteMap>
</rewriteMaps>
<rules>
<rule name="Short URL redirects">
<match url="^(.+?)/?$" />
<conditions>
<add input="{ShortURLs:{R:1}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="true"/>
</rule>
</rules>
</rewrite>
You were quite close; I only needed to make three small changes:
- removed the leading slashes in the keys in the rewrite map
- used the non-greedy quantifier
+?
in the rule's match - used a back reference to the match
{R:1}
in the condition input
I share your experience in having trouble finding decent documentation; I had to experiment my way through, with help from the following articles: