我將停用舊網站http://extranet.contoso.com但有一個特定的功能仍然需要一段時間。我想要實現的是將所有請求重定向到資訊頁面https://contoso.com/new-extranet-info-page/,不包括請求http://extranet.contoso.com/printdoc.aspx?ID=1234567&AccountID=vd3l1bn&UserID=Matt仍然應該在不被重定向的情況下進行。我確信這是簡單明了的事情,但無法弄清楚。這會將所有請求重新導向到資訊頁面,就好像否定被忽略一樣。
<rule name="Redirect to new service" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_URI}" pattern="^/printdoc\.aspx(\?.*)?$" negate="true" />
<add input="{HTTP_HOST}" pattern="^extranet\.contoso\.com$" />
</conditions>
<action type="Redirect" url="https://contoso.com/new-extranet-info-page/" appendQueryString="false" />
</rule>
當我針對 /printdoc.aspx?ID=1234567&AccountID=vd3l1bn&UserID=Matt 進行測試時,否定通過了驗證。我嘗試禁用任何其他存在的重寫規則,但這沒有效果。