【问题标题】:HTTP Error 500.52 - URL Rewrite Module ErrorHTTP 错误 500.52 - URL 重写模块错误
【发布时间】:2018-03-21 13:15:45
【问题描述】:

URL 路由工作正常,但是当我在 IIS 网站中创建应用程序时,应用程序停止工作并出现错误

HTTP 错误 500.52 - URL 重写模块

这条规则运行良好 (http://abcd/)

<rule name="AngularJS Routes" stopProcessing="false">
          <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>

但是当我更改它的应用程序时,它给出了错误 (http://abcd/app/)

<rule name="AngularJS Routes" stopProcessing="false">
          <match url="(^app/.*)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

          </conditions>
          <action type="Rewrite" url="/app/"/>
        </rule>

我在谷歌上搜索过,但没有找到解决方案。需要专家指导。谢谢

【问题讨论】:

    标签: asp.net iis url-rewriting web-config angular2-routing


    【解决方案1】:

    你的配置错误说:

    无法添加类型为“rule”且唯一键属性“name”设置为“AngularJS Routes”的重复集合条目

    您可能需要更改您的rule 名称之一才能使其正常工作,例如:

    <rule name="AngularJS Routes" stopProcessing="false">[...]</rule>
    <rule name="AngularJS App Routes" stopProcessing="false">[...]</rule>
    

    【讨论】:

      猜你喜欢
      • 2012-12-22
      • 1970-01-01
      • 2020-05-23
      • 2015-11-27
      • 2018-05-04
      • 1970-01-01
      • 2019-03-24
      • 2011-10-18
      相关资源
      最近更新 更多