gpt4 book ai didi

url-rewriting - SEO - 重定向主页或根 URL - 尾部斜线

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:28:07 26 4
gpt4 key购买 nike

有谁知道如果主页(带或不带尾部斜杠)返回 200 OK header 响应,Google 是否会惩罚网站?

我已经使用在线重定向检查器(CNN、纽约时报、FOX 新闻、维基百科等)测试了大量网站,它们都返回 200 个“ok”,有或没有尾部斜杠。

我知道所有内页都需要使用其中之一,但主页似乎是个异常(exception)。大家怎么看?

PS,我在 IIS7 中使用 URLRewrite 来强制 www、小写并删除结尾的斜杠。主页似乎是唯一不受尾部斜杠规则影响的页面。

例如,使用工具,我检查了以下网址。它们都是“直接链接”。 301 重定向也不是:

许多其他示例产生相同的结果。

这是我的 URLRewrite 代码(web.config)

    <rules>
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" />
</rule>
<rule name="LowerCaseRule1" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" redirectType="Permanent" url="{ToLower:{URL}}" />
</rule>
<rule name="Remove trailing slash" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>
</rules>

最佳答案

好的,这是来自 Google Blog 的官方答案

我引用...“请放心,对于您的根 URL,http://example.com 等同于 http://example.com/,即使你是查克诺里斯。”

就是这样。根 URL 不仅在有或没有尾部斜杠的情况下都是安全的,而且甚至不可能将一个 301 重定向到另一个。

关于url-rewriting - SEO - 重定向主页或根 URL - 尾部斜线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11355328/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com