I want to do rewriting from http://example.com/assets/file.extto /sites/example.com/assets/file.extonly if this rewritten path exists. I can do it more broadly, for example:
<rules>
<rule name="assets" stopProcessing="true">
<match url="^assets/(.+)$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www\.)?(.*)$" />
</conditions>
<action type="Rewrite" url="sites/{C:2}/assets/{R:1}" />
</rule>
</rules>
but when I add the condition <add input="{REQUEST_FILENAME}" matchType="IsFile" />, it will try to map the file to the original path.
Can this be done?
source
share