Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

url rewriting - SEO - Redirect Homepage or Root URL - Trailing Slash

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

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, 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.

Thanks!

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.

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ok, so here is the official answer from the Google Blog

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."

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...