在IIS中刷新与ASP.NET Core Web API一起托管的Angular 应用程序时,我遇到了404错误.尽管在web.config文件中添加了重写,但该问题仍然存在.我的基本URL配置如下:
<base href="/">
以下是位于wwwroot文件夹中的web.config文件的内容:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" 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>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/index.html" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
</configuration>
我试过几种方法都没有成功.有人能帮助我解决这个问题吗?任何帮助将不胜感激.谢谢