重写规则&谷歌搜索引擎

发布于 2025-01-05 15:37:16 字数 399 浏览 1 评论 0原文

我有一个位于

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

仅一夜美梦 2025-01-12 15:37:16

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.

败给现实 2025-01-12 15:37:16

大多数搜索引擎现在都支持头部中的规范链接元素,因此在安装 sub.website.com WordPress 时,您需要创建一个 WordPress 插件,为每个页面添加此元素,并使用正确的规范 URL。像这样的东西:

<link rel="canonical" href="www.website.com/some-article.aspx"/>

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:

<link rel="canonical" href="www.website.com/some-article.aspx"/>
雨落星ぅ辰 2025-01-12 15:37:16

如果您不希望 sub.website.com 上的任何内容被编入索引,您可以创建 robots.txt 文件位于 sub.website.com 的根目录中,并添加以下条目。

User-agent: *
Disallow: /

如果您只想限制某些目录,例如/articles,请将其更改为

User-agent: *
Disallow: /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 of sub.website.com and add the following entry.

User-agent: *
Disallow: /

If you only want to restrict some directories e.g /articles change it to

User-agent: *
Disallow: /articles/

If 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文