0

我使用 SQL LocalDb 在 IIS 8.0 上的机器上本地托管了一个 Orchard 站点。我还在 IIS 中安装并集成了 URL 重写模块。我已经修改了 Orchard.Web 项目中的 web.config 以重定向为

<rewrite>
  <rules>
    <rule name="Redirect services to expertise" stopProcessing="true">
      <match url="/services/(.*)" />
      <action type="Redirect" url="/expertise/{R:1}" />
    </rule>
  </rules>
</rewrite>

所以,我打算做的是重定向,"http://localhost:70/Orchard/services/content-management" to "http://localhost:70/Orchard/expertise/content-management". 但这并没有按预期工作,也没有重定向。它打开了相同的旧“../services/..” URL。

有任何想法吗?

提前致谢。

4

1 回答 1

1

我相信问题出在你的规则上。url 没有前导斜杠。尝试将规则更改为:

<rule name="Redirect services to expertise" stopProcessing="true">
  <match url="^services/(.*)" />
  <action type="Redirect" url="expertise/{R:1}" />
</rule>

这会将任何以 services/... 开头的 url 重定向到专业知识/...

于 2013-06-26T22:50:59.720 回答