IIS重写捕获所有请求而不是匹配模式

时间:2013-06-06 19:24:15

标签: iis redirect rewrite

我正在尝试将特定目录的请求重定向到具有相同目录的其他域。代码按预期工作,但即使是与模式不匹配的请求也会被重定向。是否有我遗漏的东西,所以服务器正常处理所有不匹配的请求?

示例传入的网址为http://www.inbounddomain.com/STRING2.NSF/some-really-long-file-name-that-needs-to-be-appended-to-the-redirect

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <handlers>
        <add name="Mod-Rewrite" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\SysWOW64\inetsrv\imodrewi.dll" resourceType="Unspecified" requireAccess="None" preCondition="bitness64" />
    </handlers>

<rewrite>
<rules>
<rule name="Redirect for STRING2.NSF" enabled="false" stopProcessing="true">
  <match url="(.*?)(?:STRING2.NSF/|$)(.*)" />
  <action type="Redirect" url="http://www.redirectdomain.com/STRING2.NSF/{R:2}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>

    </system.webServer>
</configuration>

0 个答案:

没有答案