301 redirect - 重定向父级而不是其子级。对于 IIS 版本 10 Windows 2019

问题描述 投票:0回答:0

我想弄清楚如何确保 301 重定向仅适用于父级及其子级。 孩子们应该有相同的网址。

这是 web.config 中的代码:

<rule name="Rewrite Change of my parent page" stopProcessing="true">
    <match url="^my_old_parent$" ignoreCase="false" />
    <action type="Redirect" url="/New-Parent-Page/" redirectType="Permanent" />
</rule>

我尝试了不同的变体,但没有任何效果。 我看着这个线程: 301 重定向 - 重定向父级而不是子级

他们提到使用 RedirectMatch 而不是 Redirect,它不适用于 IIS。

我很欣赏关于将哪些代码用于 IIS 10 的想法。

谢谢,

多伦

尝试 RedirectMatch 时,我收到一条错误消息。

redirect iis parent-child
© www.soinside.com 2019 - 2024. All rights reserved.