【问题标题】:IIS 7.5 URL rewrite redirect rule for old URL to new URL旧 URL 到新 URL 的 IIS 7.5 URL 重写重定向规则
【发布时间】:2011-08-07 02:52:15
【问题描述】:

我正在尝试映射这个旧的网络表单 URL

http://www.mysite.com/Listing.aspx?mlsnum=T5017910

到这个新的 MVC URL:

http://www.mysite.com/listing?id=T5017910

不知怎的,我无法让它工作。我的规则如下:

<rule name="My Listing Redirect Rule" stopProcessing="true">
    <match url="^Listing.aspx?mlsnum=([0-9a-z]+)" ignoreCase="true" />
    <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Redirect" url="listing?id={R:1}" redirectType="Permanent" />
</rule>

感谢任何帮助。

【问题讨论】:

    标签: asp.net regex asp.net-mvc-3 url-rewriting iis-7.5


    【解决方案1】:

    你的&lt;match url=...&gt; 需要转义? 字符试试这个:

    <match url="Listing.aspx\?mlsnum=([0-9a-z]+)" ignoreCase="true"/>
    

    【讨论】:

    • 我尝试了你的建议,但我仍然无法让它发挥作用。
    猜你喜欢
    • 2015-08-16
    • 1970-01-01
    • 1970-01-01
    • 2013-08-14
    • 1970-01-01
    • 2014-10-27
    • 2011-09-02
    相关资源
    最近更新 更多