SEO - 重定向主页或根 URL - 尾部斜杠 [英] SEO - Redirect Homepage or Root URL - Trailing Slash

查看:59
本文介绍了SEO - 重定向主页或根 URL - 尾部斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Does anyone know if Google will punish a site if the homepage (with or without the trailing slash) returns a 200 ok header response?

我使用在线重定向检查器(CNN、纽约时报、FOX 新闻、维基百科等)测试了大量网站,它们都返回 200ok",无论是否带有斜杠.

I have tested tons of sites using an online redirect checker (CNN, NY Times, FOX News, Wikipedia, etc...) and they all return 200 "ok" with or without the trailing slash.

我知道所有内页都需要使用一个或另一个,但主页似乎是一个例外.大家怎么看?

I know all inner pages need to use one or the other, but it appears the homepage is an exception. What do you all think?

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

PS, I'm using URLRewrite in IIS7 to force www, lowercase, and remove trailing slashes. It seems the homepage is the only page not affected by the trailing slash rule.

谢谢!

编辑例如,使用这个在线工具:http://www.internetofficer.com/seo-工具/重定向检查/以下 URL 是直接链接".301重定向也不是......http://www.wikipedia.orghttp://www.wikipedia.org/

EDIT For example, using this online tool: http://www.internetofficer.com/seo-tool/redirect-check/ The following URLs are "Direct Links". Neither is a 301 redirect... http://www.wikipedia.org http://www.wikipedia.org/

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

Numerous other examples produce the same results.

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

EDIT 2 Here is my URLRewrite code (web.config)

    <rules>
        <rule name="CanonicalHostNameRule1" stopProcessing="true">
            <match url="(.*)" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^www\.domain\.com$" negate="true" />
            </conditions>
            <action type="Redirect" redirectType="Permanent" url="http://www.kurtzandblum.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 博客

我引用..."请放心,对于您的根 URL,http://example.com 等效于 http://example.com/ 并且即使您是 Chuck Norris 也无法重定向."

And I quote... "Rest assured that for your root URL specifically, http://example.com is equivalent to http://example.com/ and can’t be redirected even if you’re Chuck Norris."

所以你有它.根 URL 不仅有或没有尾部斜杠都是安全的,而且 301 甚至可能无法将一个重定向到另一个.

So there you have it. The root URL is not only safe with or without a trailing slash, but it might even be impossible to 301 redirect one to the other.

这篇关于SEO - 重定向主页或根 URL - 尾部斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆