-1

我有一个测试域,它在 goolge 中被索引,但它是错误的。

现在我需要创建从具有所有参数的所有页面到其他域的 301 重定向。

我可以创建动作过滤器并在其上创建重定向,但这对我来说也是错误的。

我知道它可以在 webconfig 中实现什么。但我不明白怎么做。

请你帮帮我。

我尝试使用:

<rewrite>
<rules>
<rule name="Redirect to main subdomain from test domain">
    <match url="^.*$" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^(www\.)uh261477\.ukrdomen\.com$" ignoreCase="true" />
     </conditions>
     <action type="Rewrite" url="http://kitesurfing-base.com{R:0}"  redirectType="Permanent" />
</rule>
</rules>
</rewrite>

但它不起作用

4

1 回答 1

1

您可以将此规则放在您web.config的重定向中:

<rule name="Redirect to main subdomain from test domain">
    <match url="^.*$" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^(www\.)testdomain\.com$" ignoreCase="true" />
     </conditions>
     <action type="Rewrite" url="http://otherdomain.com{R:0}"  redirectType="Permanent" />
</rule>
于 2013-10-26T09:19:12.527 回答