繁体   English   中英

IIS 7.5 URL重写将旧URL重定向到新URL的重定向规则

[英]IIS 7.5 URL rewrite redirect rule for old URL to new URL

我正在尝试映射此旧的Webform 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>

任何帮助表示赞赏。

您的<match url=...>需要转义? 字符试试看:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM