【发布时间】:2016-08-24 05:43:37
【问题描述】:
我正在为我的一位客户创建一个新网站。他们的旧网站是使用 wordpress 开发的,因此它有 100 个损坏的网址,如下所示:
http://www.example.com/best-gym-in-town/
http://www.example.com/video-gallery/
http://www.example.com/fun-stuff/
http://www.example.com/are-you-a-diabetes-patient/
http://www.example.com/john-in-media/
http://www.example.com/photo-gallery/
http://www.example.com/nutrition-program-that-suits-your-lifestyl/
http://www.example.com/our-range-of-fitness-tests/
http://www.example.com/corporate-group-workshops/some-article/another-article
我正在 asp.net mvc 5 中开发新站点。我想在 web.config 中编写一个 httpRedirect 规则,可以将上述任何 URL 重定向到主页或任何特定页面。
到目前为止,这就是我对解决方案的看法
<location path="about-me">
<system.webServer>
<httpRedirect enabled="true" destination="/home"
httpResponseStatus="Permanent" />
</system.webServer>
</location>
但我必须在 web.config 中编写 100 条这样的条目。我正在寻找更好更高效的替代方案
【问题讨论】:
标签: iis asp.net-mvc-5 web-config