我想将所有文件请求(.js,.css等)重写到子文件夹,并将其他请求重写到dist/200.html
。我无法匹配文件请求。
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
只能用于否定条件吗?
<rule name="Routes" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions
<action type="Rewrite" url="dist/200.html" />
</rule>
<rule name="Files" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="dist/{R:1}" />
</rule>