Reputation: 701
I'm trying to rewrite all requests from e.g /img/logo.svg to go to /dist/img/logo.svg
Any idea? I'm sure it's something obvious.
<rule name="RewriteImgFolder" stopProcessing="true">
<match url="^/img/(.*)" />
<action type="Rewrite" url="/dist/img/{R:1}" />
</rule>
Upvotes: 0
Views: 36
Reputation: 28192
If your url is http://localhost/img/logo.svg
, your url rewrite rule will not work.
You could remove the "/" in the match url.
More details, you could refer to below rules:
<rule name="RewriteImgFolder" stopProcessing="true">
<match url="^img/(.*)" />
<action type="Rewrite" url="/dist/img/{R:1}" />
</rule>
Upvotes: 1