【问题标题】:IIS URL Rewrite to correct an bad urlIIS URL 重写以更正错误的 url
【发布时间】:2016-10-07 19:59:07
【问题描述】:

我输入了一个错误的网址

http:/example.com/path/file.html how

我怎样才能把它改成

http://example.com/path/file.html how

注意http:\http:\\

我不想只为一个 url 修复它,我想为所有碰巧有错误 IIS URL Rewrite 的 url 修复它。

我之前编写了许多 URL Rewrites,但由于某种原因,我无法弄清楚这一点。

【问题讨论】:

    标签: iis url-rewriting iis-7.5 url-rewrite-module


    【解决方案1】:

    我想我想通了,可能有更好的方法,但这似乎可以解决问题。

    <rule name="Fix Slash Issue" stopProcessing="true">
          <match url="^(http.?:\\[a-zA-Z0-9])" />
          <action type="Redirect" url="https:\\{HTTP_HOST}\{REQUEST_URI}" />
    </rule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-04
      • 1970-01-01
      • 2011-11-29
      • 2016-06-27
      • 2013-06-16
      相关资源
      最近更新 更多