I am stuck on a very simple IIS rewrite rule. I have a series of links that have an invalid path, and I need to redirect all requests to that path to a new one.
Here is the broken path: https://documentation.buzsoftware.com/buzdocs/BuzClubManager/index.cfm?ID=690
The "buzdocs" portion of the path no longer exists and all links below this path have been moved up one folder to this example path (which works): https://documentation.buzsoftware.com/BuzClubManager/index.cfm?ID=690
<rule name="buzdocs_path_del" stopProcessing="true">
<match url="(.*)/buzdocs(.*)" />
<action type="Rewrite" url="{R:1}{R:2}" appendQueryString="false" />
</rule>
or
<rule name="buzdocs_path_del" stopProcessing="true">
<match url="https://documentation.buzsoftware.com/buzdocs(.*)" />
<action type="Rewrite" url="https://documentation.buzsoftware.com/{R:1}" appendQueryString="false" />
</rule>
I have been trying a wide variety of regex patterns, and every time I go to the incorrect path I get a 404, and I am not redirected.
I'm not sure if I need to use the ^ (start of line) or $ (end of line) in the pattern match, I've tried both with the same result.
Using only the {R:1} (first example) vs. using both {R:1} and {R:2} (second example), not sure which is the right way. Any comments on best practices would be helpful.
I've also bounced back and forth between <action type="Rewrite"
and <action type="Redirect"
, with no change.
These links are to a live site, feel free to hit them. Thanks for any advise, I'm pretty sure I'm missing something small, and I will probably hit my head on my desk for it.