我该如何告诉搜索引擎不通过二级域名的内容编制索引? [英] How do I tell search engines not to index content via secondary domain names?

查看:118
本文介绍了我该如何告诉搜索引擎不通过二级域名的内容编制索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站a.com(例如)。我也有一对夫妇的其中我没有使用任何东西其他域名:b.com和c.com。目前,他们转发给a.com。我注意到,谷歌正在使用b.com/stuff和c.com/stuff,而不仅仅是a.com/stuff我的网站索引内容。什么是正确的方式告诉谷歌只索引的内容通过a.com,不b.com和c.com?

I have a website at a.com (for example). I also have a couple of other domain names which I am not using for anything: b.com and c.com. They currently forward to a.com. I have noticed that Google is indexing content from my site using b.com/stuff and c.com/stuff, not just a.com/stuff. What is the proper way to tell Google to only index content via a.com, not b.com and c.com?

看来,如果301通过htaccess的重定向是最好的解决办法,但我不知道该怎么做。只有一个htaccess文件(每个域不具有其自己的htaccess文件)。

It seems as if a 301 redirect via htaccess is the best solution, but I am not sure how to do that. There is only the one htaccess file (each domain does not have its own htaccess file).

b.com和c.com并不意味着是a.com的别名,他们只是其他域名,我保留为将来可能的项目。

b.com and c.com are not meant to be aliases of a.com, they are just other domain names I am reserving for possible future projects.

推荐答案

您可以简单地创建一个重定向一个的.htaccess 文件是这样的:

You can simply create a redirect with a .htaccess file like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} \.b\.com$ [OR]
RewriteCond %{HTTP_HOST} \.c\.com$
RewriteRule ^(.*)$ http://a.com/$1 [R=301,L]

这篇关于我该如何告诉搜索引擎不通过二级域名的内容编制索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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