IIS 部署angular 路由设置,简单记录下

<configuration>
<system.webServer>
 <rewrite>
    <rules>
      <rule name="Angular Routes" stopProcessing="true">
      <!--当路由字符串中不包含“webapi/api/”时,路由将指向angular路由!-->
        <match url="^((?!webapi/api/).)*$" />
        <conditions logicalGrouping="MatchAll">
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <action type="Rewrite" url="/index.html" />
      </rule>
    </rules>
  </rewrite>
</system.webServer>
</configuration>

 

posted @ 2020-12-11 15:37  youliCC  阅读(296)  评论(0编辑  收藏  举报