<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="API Rule" stopProcessing="true">
<match url="^(api|account|manage)(.*)$" />
<action type="None" />
</rule>
<rule name="Angular Rule" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
1、安装 url rewrite模块到IIS( https://www.iis.net/downloads/microsoft/url-rewrite)
2、然后在web.config文件中添加上面的配置