'Is this a properly formatted url rewritr rule?

I am trying to redirect the two links below to the root. My question is can you see a problem with my rule written below?

Thank You!

http://pollen.aaaai.org/nab/collectors/

http://pollen.aaaai.org/nab/collectors/index.cfm?p=Count_form

<rule name="Redirect /nab/collectors/ to http://pollen.aaaai.org/" patternSyntax="Wildcard" stopProcessing="false">
    <match url="*/nab/collectors/*" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTPS}" pattern="^OFF$" />
    </conditions>
    <action type="Rewrite" url="http://pollen.aaaai.org" appendQueryString="false" />
</rule>
iis


Solution 1:[1]

There is a problem with your parameter, it matches the content after the hostname and does not contain "/". you can refer to below rule about redirect to root.

Note: I changed patternSyntax from wildcards to regular expressions.

<rule name="Redirect /nab/collectors/ to http://pollen.aaaai.org/" patternSyntax="Regular Expressions" stopProcessing="false">
  <match url=".*" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
      <add input="{HTTPS}" pattern="^OFF$" />
    </conditions>
  <action type="Rewrite" url="http://pollen.aaaai.org" appendQueryString="false" />
</rule>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 samwu