2011-04-16 131 views
0

我想IIS 7.5 URL重寫重定向規則的舊網址到新網址

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

映射這個老的網絡表單網址這一新的MVC網址:

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> 

任何幫助表示讚賞。

回答

0

<match url=...>需要躲避?字符試試這個:

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

我想你的建議,但我仍然無法得到它的工作。 – thd 2011-04-22 11:02:47

相關問題