Forum Moderators: phranque

Message Too Old, No Replies

301 to / or index?

Is there a preference or reason for 1 vs the other?

         

chewy

7:47 pm on Jun 18, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've got a project where there's a bunch of directory1/directory2/index.html type links.

I know that this can also be regarded as a directory1/directory2/ and as such can be regarded as duplicate content.

I know that good practices have on-site links all linking to one type so as to avoid duplicate issues.

But in the case where off-site links are linked to both flavors, is there a good reason to redirect one way or another?

Should I redirect / to index using this:

RedirectMatch ^/$ /index.html


or index to / ? like this:

RedirectMatch /index.html ^/$


In the case where there is a predominant style of backlinking (say using the index.html), I would choose redirecting to index.html.

But in the case where there is no obvious backlink style, is one approach better than the other?

Thanks!

-C

g1smd

7:54 pm on Jun 18, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use a RewriteRule and redirect to the shorter URL.

The canonical URL for a folder or for the index page in a folder ends in a trailing slash.

I posted the code you need in another thread only an hour or so ago. It's a regular question here.

The redirect target must include the canonical domain name otherwise non-canonical page requests on the non-canonical domain will result in a double redirect to the canonical URL. You do not want a redirection chain.

chewy

8:10 pm on Jun 18, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



yup.

so much great stuff is buried (and repeated) in these threads.

thanks

and congrats for passing 17K responses.