开发者

two sites, same content, how to redirect?

I've a question for you, i need to mainta开发者_StackOverflow中文版in two sites (let's name them example.com and yyy.com), they will be something like an alias.

I want visitors to be able to access the pages with same content via both of them. what's the best way of doing this without getting in trouble with search engines?

I know about the 301 redirect, but i want visitors to stay on example.com or yyy.com, same name to show up in address bar, not to be redirected.


One thing you could do is to use the rel=canonical tag on the pages of the site you consider to be "the copy".

Basically, in the head section of each page's HTML you can tell which page on the "original" site has the same content. So if (for instance) your sites are called www.yourmainsite.com and www.yoursecondsite.com, you should tag testpage.htm on yoursecondsite.com like this:

<link rel="canonical" href="http://www.yourmainsite.com/testpage.htm"/>

See here for more details.

Otherwise you can simply tell search engines not to index yoursecondsite.com in your robots.txt

  User-agent: *
  Disallow: / 

Warning: I'm not an SEO person. I did have to implement something similar, but take my advice with a grain of salt


From the theoretical point, "Content-Location" HTTP header was invented for this as defined here and explained here.

However, search engines prefer "canonical" link tag (as in Paolo's explanation) for the same purpose because "Content-Location" header is mostly being misused by the web designers.

I would probably use both.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜