asp.net url重写

时间:2012-06-27 10:03:35

标签: asp.net url-rewriting

<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重写配置来重写其中一个页面。我在浏览器中收到以下错误。谁能告诉我我做错了什么?

表达式“\ Test1.aspx $”包含无效的转义序列。

1 个答案:

答案 0 :(得分:2)

试试这个:

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