最近、WebサイトをWindows Server 2008を実行し、その後IIS7でホストされている新しいサーバーに移行しました。
ページの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
誰かが私を正しい方向に向けることができますか?これを数回検索しましたが、何も見つからないようです。