我想將舊目錄重定向到新目錄(301重定向)。在我的情況,我想這一點:如何將舊目錄重定向到IIS上的新目錄
http://www.mydomain.com/xxxx/重定向到http://www.mydomain.com/yyyy/
http://www.mydomain.com/xxxx/1-my-product-name重定向到http://www.mydomain.com/yyyy/1-my-product-name
http://www.mydomain.com/xxxx/c/my-category-name重定向到http://www.mydomain.com/yyyy/c/my-category-name
等等
爲此,我使用IIS上的URL重寫模塊來執行此操作。這是我在我的web.config規則:
<rule name="test" stopProcessing="true">
<match url="xxxx" />
<action type="Redirect" url="yyyy{R:0}" appendQueryString="true" />
</rule>
它正常工作與http://www.mydomain.com/xxxx/1-my-product-name和http://www.mydomain.com/xxxx/c/my-category-name但是當我去http://www.mydomain.com/xxxx/它重定向到http://www.mydomain.com/yyyy//有兩個slahes。任何人都知道如何避免這一點?
在此先感謝!