在iis服务器上托管角度应用程序后,直接url无法正常工作,或者输入页面刷新无效

时间:2018-03-12 05:26:49

标签: iis-7 angular2-routing angular4-router

请查找web.config代码

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="AngularJS" 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>

每当我输入URL ex myapp / orderform时,它总是呈现回家或提供文件或目录不存在的错误。

0 个答案:

没有答案