2012-06-27 52 views
1
<rule name="test" stopProcessing="true"> 
        <match url="\Test1.aspx$" /> 
        <conditions logicalGrouping="MatchAll"> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="Test1" appendQueryString="true" /> 
       </rule> 

我正在使用上面的url重寫配置來重寫其中一個頁面。我在瀏覽器中收到以下錯誤。誰能告訴我我做錯了什麼?asp.net url rewrite

表達式「\ Test1.aspx $」包含一個無效的轉義序列。

回答

2

試試這個:

<match url="^/Test1\.aspx$" /> 
+3

豈不是'<匹配URL = 「^/Test1的\ $的.aspx」/>'的'.'是正則表達式中的特殊字符? – kolin

+0

@科林:感謝您的糾正。 –