angular应用程序显示刷新后未找到的页面

angular应用程序显示刷新后未找到的页面,angular,iis,Angular,Iis,这个问题在互联网上被问了很多次,我跟踪了所有的问题,但我还是犯了一个严重的错误 以下是错误: 这是我的配置文件: <configuration> <system.webServer> <rewrite> <rules> <rule name="Angular Routes" stopProcessing="true"> <match url=".*&q

这个问题在互联网上被问了很多次,我跟踪了所有的问题,但我还是犯了一个严重的错误

以下是错误:

这是我的配置文件:

<configuration>

<system.webServer>

 <rewrite>

  <rules>

  <rule name="Angular 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="/WebPark/" />

     </rule>
    </rules>
   </rewrite>
   </system.webServer>

</configuration>


该应用程序的名称是WebPark。

我看到的与中IIS设置建议的不同之处在于,您的配置被包装在
标记中。

您应该对使用角度路由器而不是路由器的web服务器(IIS)说

从下载并安装URL重写模块后,应将此配置文件添加到IIS应用程序文件夹:

Web.config
文件

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=169433
  --><configuration>

<system.webServer>

  <rewrite>

    <rules>

      <rule name="Angular 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>

</system.webServer>

</configuration>


上面的代码是完整的文件内容。

我删除了它,但仍然是相同的问题,在我的模块中添加了provide:LocationStrategy,useClass:HashLocationStrategy}。它工作正常,但在我的地址中添加了一个额外的#