【问题标题】:301 Redirect specific pages in webconfig IIS7301重定向Web配置IIS 7中的特定页面
【发布时间】: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


    【解决方案1】:

    原来我没有在本地 IIS 中打开 HTTP 重定向。 (我阅读的教程没有提到)。所以现在 IIS 可以让我重定向了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-09
      • 2012-01-15
      • 1970-01-01
      • 2012-10-11
      • 2023-02-24
      • 2010-12-09
      • 2016-01-27
      相关资源
      最近更新 更多