工作我最近遷移的網站轉移到運行Windows Server 2008,然後在新服務器上的IIS 7的Response.Redirect停止了與IIS 7條重寫規則
我已經實現URL重寫規則的網頁被託管。這是一個例子。
<rule name="RewriteUserFriendlyURL58" stopProcessing="true">
<match url="^(shop)/(item)/([^/]+)/([^/]+)/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="shopitem.aspx?{R:1}&{R:2}&id={R:3}&cat={R:4}&title={R:5}" />
</rule>
URL應該看起來像這樣。 http://www.website.com/shop/item/10/products/table/
除了當我點擊一個按鈕並運行此事件時,該頁面正常工作。
protected void btnAddToBasket_Click(object sender, EventArgs e)
{
Response.Redirect("~/shoppingbasket/");
}
重定向的結果似乎是對自身重定向,然後將URL更改爲:http://www.website.com/shop/item/10/products/table/?shop&item&id=10&cat=products&title=table
任何人都可以點我在正確的方向?我已經做了一些搜索,我似乎無法找到任何東西。
您是否嘗試過使用[失敗請求追蹤工具](http://www.iis.net/learn/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-規則)看看發生了什麼? – cheesemacfly 2013-03-16 17:41:29