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>
本文作者:youliCC