【发布时间】:2012-06-05 01:15:33
【问题描述】:
我正在尝试使用 web.config 文件重定向我网站上的几个特定页面。这些页面中的大多数不仅不再存在,而且文件夹结构也不再存在。 例如 mysite.com/oldfolder/index.aspx 不再存在 oldfolder 不存在。所以我想在我的项目的 web.config 中说明“所有对 /oldfolder/index.aspx 的请求现在都转到 /newfolder/index.aspx”。我做了一些挖掘,这似乎是最有意义的:
<location path="oldfolder/index.aspx">
<system.webServer>
<httpRedirect enabled="true" destination="newfolder/index.aspx" httpResponseStatus="Permanent" />
</system.webServer>
</location>
但是当我尝试转到 oldfolder/index.aspx 时,它的行为就像它甚至不存在并且抛出错误一样。我究竟做错了什么?还是我完全以错误的方式攻击它?
【问题讨论】:
标签: .net redirect iis-7 web-config http-status-code-301