小编san*_*ndy的帖子

我们真的需要 URL 重写模块来在 IIS 上托管 Angular 应用程序吗?

对于我们来说,Angular 应用程序无需在 IIS 上安装 URL 重写模块即可运行。我们是否需要 URL 重写模块来在 IIS 上托管 Angular 应用程序?如果我们不安装它会有什么区别?

它适用于下面的 web.config..我刚刚评论了重写部分并添加了
默认文档

<?xml version="1.0" encoding="utf-8"?>
<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="/SCOAP/index.html" />
      </rule>
    </rules>
  </rewrite> -->
  <defaultDocument enabled="true">
         <files>
            <add value="index.html" />
         </files>
  </defaultDocument>
</system.webServer>

</configuration>
Run Code Online (Sandbox Code Playgroud)

url-rewrite-module iis-8 angular

4
推荐指数
1
解决办法
5295
查看次数

标签 统计

angular ×1

iis-8 ×1

url-rewrite-module ×1