7
如何在web.config文件的url重寫規則中使用&符號(&
)?使用IIS 7重寫模塊重寫&符號
我要重寫的網址:
http://www.foo.com/index.asp?SomeParameter=SomeValue&SomeId=00
到:
http://www.foo.com/Section/Page
我寫在我的web.config以下規則:
<rule name="RuleName" stopProcessing="true">
<match url="^index.asp?SomeParameter=SomeValue&SomeId=00" ignoreCase="true" />
<action type="Redirect" url="Section/Page" appendQueryString="false" />
</rule>
,但我有輸入網址中的&符號(&
)存在問題。當試圖重寫時,我得到:
請求的頁面無法訪問,因爲頁面的相關 配置數據無效。
我試圖解析&符號到%26
,但我得到相同的錯誤。