我们是否真的需要URL重写模块来托管IIS上的Angular应用



for US Angular App正在使用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>

Angular主要用于编写水疗中心。因此,您可能会有"/home","/home"和其他应该运行相同角度应用程序的URL,但您的应用程序将呈现不同的内容。因此,当用户导航到" yoursite.com/home"时,应该看到Angular App Home Page。然后重写您只会看到404(因为没有/home.html在于来源(

最新更新