【问题标题】:IIS URL Redirect works, but Rewrite throws 403 forbidden errorIIS URL 重定向工作,但重写抛出 403 禁止错误
【发布时间】:2014-11-17 19:47:15
【问题描述】:

我在这样的 IIS 应用程序的子目录中有一个 web.config 文件

<configuration>
  <system.webServer>
      <rewrite>         
          <rules>
            <rule name="Proxy2" stopProcessing="true" patternSyntax="Wildcard">
                <match url="*"  ignoreCase="true"/>
                    <conditions>
                      <add input="{HTTP_HOST}" pattern="*" />
                  </conditions>
                <action type="Rewrite" url="http://anotherurl.com/{R:0}" />
            </rule> 
        </rules>
      </rewrite>
  </system.webServer>
</configuration>

所以,如果我浏览 https://www.abc.com/subdir ,它将返回 403 禁止错误。但是如果我将操作更改为重定向,它将毫无问题地重定向。我应该寻找什么来发现问题?

【问题讨论】:

    标签: asp.net iis


    【解决方案1】:

    无法重写到另一个 URL(或另一个应用程序池)。在这种情况下,只有重定向有效。

    编辑:技术上它是可能的,但不是你实现它的方式。如果要重写到另一个 URL,则需要使用 IIS 中的Application Request Routing (ARR) 模块实现反向代理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-27
      • 2020-05-30
      • 1970-01-01
      • 2013-06-23
      • 2017-10-06
      相关资源
      最近更新 更多