重写规则&谷歌搜索引擎
我有一个位于
www.website.com 的
网站,其中一些页面有指向
sub.website.com 的 重写代理规则 (驻留在不同服务器上的 WordPress 安装)
例如; www.website.com/some-article.aspx 显示来自 => 的内容sub.website.com/articles/some-article/ (并且地址保持不变)
问题是谷歌将为这两个页面建立索引,这会创建重复的内容。 我只希望谷歌索引此页面:www.website.com/some-article.aspx
有人对此主题有经验或有想法吗?
谢谢。
I have a website located on
www.website.com
some of the pages have a rewrite proxy rule pointing to
sub.website.com
(a wordpress installation which resides on a different server)
so for example;
www.website.com/some-article.aspx shows content from => sub.website.com/articles/some-article/
(and the address remains untouced)
The problem is Google will index both of the pages, which creates duplicate content.
I only want google to index this page: www.website.com/some-article.aspx
Anyone have experience on the subject, or got an idea?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
WordPress 的几个 SEO 插件将规范标签添加到页面中,该标签将告诉搜索引擎您的哪个域包含官方版本。一旦激活应该就没有问题了。
Several SEO plugins for WordPress add the canonical tag to a page that will tell search engines which one of your domains contains the official version. Once activated there should be no issue.
大多数搜索引擎现在都支持头部中的规范链接元素,因此在安装 sub.website.com WordPress 时,您需要创建一个 WordPress 插件,为每个页面添加此元素,并使用正确的规范 URL。像这样的东西:
Most search engines now support canonical link elements in the head section, so on your sub.website.com wordpress installation, you would need to create a wordpress plugin that would add this element for each page, with the correct canonical URL. Something like:
如果您不希望
sub.website.com
上的任何内容被编入索引,您可以创建 robots.txt 文件位于sub.website.com
的根目录中,并添加以下条目。如果您只想限制某些目录,例如
/articles
,请将其更改为如果
sub.website.com
的根目录与任何其他站点共享,例如www。 website.com
,然后看到这个 帖子有关如何修改 .htaccess 以提供正确的 robots.txt 的说明If you do not want any content on the
sub.website.com
indexed, you can create a robots.txt file in the root directory ofsub.website.com
and add the following entry.If you only want to restrict some directories e.g
/articles
change it toIf the root directory of
sub.website.com
is shared with any other site e.g.www.website.com
, then see this post for instructions on how to modify your .htaccess to serve the correct robots.txt