IIS URL Rewrite Rules

左心房为你撑大大i 提交于 2019-12-05 06:24:08

I need to change the pattern and change {REQUEST_FILE} to {REQUEST_URI} in a couple of places. See my demo here:

<rewrite>
  <rules>
    <rule name="MainRule" stopProcessing="true">
      <match url=".*" />
      <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{REQUEST_URI}" matchType="Pattern" pattern="api/(.*)" negate="true" />
        <add input="{REQUEST_URI}" matchType="Pattern" pattern="signalr/(.*)" negate="true" />
      </conditions>
      <action type="Rewrite" url="Default.cshtml" />
    </rule>
  </rules>
</rewrite>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!