I'm trying to use the web.config's <rewrite> section to override an emitted GIF file that is used for styling a menu toolbar. The GIF is emitted from a DLL that I don't have full access to (External tool).
I've tried several variations, and so far, the closest that I have come is to accidentally rewrite everything on the page to the recreated/restyled GIF sprite I created.
The URL will look similar to this:
https://localhost:1365/WebResource.axd?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1&t=638435890000000000
The WebResource.axd's "d" parameter value doesn't change, the only part that does is the value of the "t" parameter.
I've had success using the section using this rule:
<configuration>
<rewriter>
<redirect url="^~/WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1(.*)$" to="~/CSS/SpriteOverrides/ToolBars.gif" />
</rewriter>
</configuration>
However, I'm trying to use the <rewrite> section's rules to that I can make use of the more robust values available in the <rule>, in particular the "stopProcessing" property. So ultimately, it would look something like this:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RadEditorToolbarSprite" enabled="true" stopProcessing="true">
<match url="/.*WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1.*"></match>
<action type="Rewrite" url="/CSS/SpriteOverrides/ToolBars.gif"></action>
</rule>
</rules>
<rewrite>
<system.webServer>
</configuration>
I'm not at all an expert in using RegEx, but as near as I can tell using matches via an online tool such as https://www.regex101.com, many of the following examples should form some variation of a match:
/.*WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1.*
\/WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1(.*)$
WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1(.*)$
/WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1.*
(WebResource\.axd\?d=zcXN5Gw-34RBUm_X_907PZUSePk1HAk6aIHCp5Dp3XUp-KQFCEEOLKazKeFqN9mAdZuYIY1BUUkjwExiZJQBv8YrrpYTnZFyW6nm6TD34T3ej6FgsJEn2bHckL85ESOIqQyg_sJo8juhiXSTsTTy--IAgtI1.*)?
=> Changes everything to the graphic
None of these, or the original example in the <redirect> seem to create a successful match where the URL is successfully rewritten to my ToolBars.gif.
I feel like there must be something simple that I'm missing, and I'm not sure if I need into any of the "{R:x}" values when building out my <match url="">. Does anyone have any thoughts/ideas for what I might be doing incorrectly here?
Thank you in advance for any help.