我试图用一些更具描述性的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/ –