You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

部署Angular 4应用到IIS后出现HTTP Error 500.19错误求助

Angular SPA Route Rewrite Failures on IIS (Multiple Fixes Attempted)

Hey folks, this isn't my first time raising this issue—I've tested a number of related solutions but haven't been able to resolve it yet. Here's all the key context to help diagnose the problem:

Relevant Configuration Details

  • IIS Physical Path: C:\eCommerceWebsite
  • index.html <base> tag setup:
<base href="/eCommerceWebsite/">
  • Initial Web.config rewrite rules:
<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" /> 
          <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="/" /> 
      </rule> 
    </rules> 
  </rewrite> 
</system.webServer>
  • Updated Web.config rewrite rules (after initial attempts failed):
<?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" /> 
            <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> 
          </conditions> 
          <action type="Rewrite" url="/eCommerceWebsite" /> 
        </rule> 
      </rules> 
    </rewrite> 
  </system.webServer> 
</configuration>

I've also included relevant error screenshots to help pinpoint the issue. Could you please identify where I'm going wrong and outline the specific changes needed to fix this?


内容的提问来源于stack exchange,提问作者Nikson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:07:59