【发布时间】:2014-08-25 07:19:46
【问题描述】:
我的旧网站有一个 HTML 页面,需要 301 重定向到新网站的 aspx 页面,这两个网站都是在 asp.net 平台上构建的。请建议我如何配置我的 web.config 文件来完成这项任务。 目前我正在使用 Meta Refresh 来执行此操作,但这可能是 200 而不是 301。
任何帮助将不胜感激,谢谢。
我在旧网站的 web.config 文件中使用了以下代码,但效果不佳
<configuration>
<location path="http://example.htm">
<system.webServer>
<httpRedirect enabled="true" destination="http://newwebsite.com/test.aspx" httpResponseStatus="Permanent" />
</system.webServer>
</location>
</configuration>
【问题讨论】: