【问题标题】:IIS 7 - Rewrite rule not firing, but does work with RedirectIIS 7 - 重写规则未触发,但可以与重定向一起使用
【发布时间】:2013-01-30 05:10:19
【问题描述】:

我在 IIS 7 上设置了以下重写规则:

<rule name="Rewrite /publicfiles/GUID/file.ext" stopProcessing="true">
    <match url="^/?publicfiles/(.*)/(.*)" />
<action type="Rewrite" url="http://www.domain.tld" appendQueryString="false" /
</rule>

当我尝试它时,它似乎没有触发。我收到 404 错误,但如果我将类型更改为 Redirect,它会触发并将我发送到指定的 URL。有人能对此有所了解吗?

编辑: 我将规则的定义添加到我的 IIS 服务器而不是我的站点的 web.config 中,然后它运行良好。但是,这不是很可行,因为我需要为各个站点配置规则。有什么想法吗?

【问题讨论】:

标签: iis iis-7 url-rewriting rewrite


【解决方案1】:

毕竟这与全球规则无关。原来我必须安装应用程序请求路由,然后它使用站点规则:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-11
    • 1970-01-01
    • 1970-01-01
    • 2011-05-07
    • 2012-05-27
    • 2014-05-01
    • 2020-07-03
    • 2014-08-22
    相关资源
    最近更新 更多