我試圖用一些更具描述性的URL來重定向一些不友好的URL。這些網址以.aspx?cid=3916
結尾,每個類別名稱頁面的最後幾位數字不同。我希望它重定向到Category/CategoryName/3916
。我在web.config
文件試過這樣:在web.config文件中設置重定向
<location path="Category.aspx?cid=3916">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.site.com/Category/CategoryName/3916" httpResponseStatus="Permanent" />
</system.webServer>
,但因爲它沒有隻用擴展名結尾,它沒有工作。有沒有簡單的方法來使這個工作?我正在使用IIS 7.5。
此選項需要IIS7 https://blogs.msdn.microsoft.com/kaushal/2013/05/22/http-to-https-redirects-on-iis-7-x-and-higher/ –