在 Drupal 中为首页设置规范标签?

发布于 2024-11-16 22:55:38 字数 447 浏览 1 评论 0原文

在我的大多数 drupal 6 站点中,我使用 pathauto、xmlsitemap 和 nodewords。我喜欢为所有页面添加规范标签,作为防止重复内容的附加保护层。

我网站的首页设置为“node/31”。我今天早上遇到的问题是 Google 将“node/31”索引为首页。 (它在我的 XML 站点地图以及规范标记中。)所以我安装了全局重定向,所以现在“node/31”重定向到“/”。我还从 xmlsitemap 中删除了主页。我认为谷歌很快就会从其索引中删除“node/31”。一切都很好......除了规范标签仍然显示“node/31”。

我确信这里有一个简单的解决方案,但由于某种原因我就是想不出它是什么。最简单的解决方案似乎是为“node/31”创建一个到“/”的路径别名,但这是不可能的。我还尝试通过 admin/content/nodewords/meta-tags/frontpage 设置首页的规范标签,但似乎没有效果。

In most of my drupal 6 sites, I use pathauto, xmlsitemap and nodewords. I like having canonical tags for all pages, as an added layer of protection against having duplicate content.

My site's front page is set to "node/31". The problem I ran into this morning was that Google had indexed "node/31" as the front page. (It was in my XML sitemap, as well as the canonical tag.) So I installed globalredirect, and so now "node/31" redirects to the "/". I also removed the home page from the xmlsitemap. I assume that google will soon remove "node/31" from its index. All is good... except that the canonical tag still shows "node/31".

I'm sure there is an easy solution here, but for some reason I just can't think what it is. The easiest solution would seemingly be to create a path alias for "node/31" to "/", but that's not possible. I also tried to set the canonical tag for the front page via admin/content/nodewords/meta-tags/frontpage but it seems to have no effect.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

潦草背影 2024-11-23 22:55:38

尝试 donwords 配置,它允许特定的首页标签,并在节点编辑表单中输入标签。
此选项之一应该可以解决您的

问题

Try the donwords configuration, it allows for a specific front page tags, and entering tages in the node edit forms.
one of this options should resolve your problem

Avner

老子叫无熙 2024-11-23 22:55:38

@kiamlaluno 是的,你是对的,这是一个非常本地化的问题。这是 3 个问题,但它们都与不同模块如何与首页交互有关。我本可以将其分成 3 个更一般的问题,但它们都与别名有关。

@AgA:这都是关于控制的。我想控制 Google 索引的网址,并且不想要重复的内容。 (此外,客户只是不想在任何地方看到“node/xxx”。)

我确实找到了解决方案:

  1. 从 XML 站点地图中删除首页。无论如何,它都会被索引。
  2. 删除首页的任何别名。
  3. 在 Nodewords 设置中,选择“使用首页元标记”。

我对此解决方案唯一不喜欢的是我的网站编辑器无法再在节点编辑页面上编辑任何元标记。一旦您选择“使用首页元标记”,更改它们的唯一方法似乎是在 Nodwords 管理页面上。

“使用首页元标记”有点令人困惑,因为在我启用此设置之前,Nodewords 已经插入了规范标记。此外,很容易在 admin/content/nodewords/meta-tags/frontpage 中输入标签,以为它们会显示在主页上,结果却意识到您还必须启用“使用首页元标签”。

问题解决了。

@kiamlaluno yeah, you're right, it's a very localized question. It's 3 questions in one, but they are all related to how different modules interact with the front page. I could have broken it up into 3 more general questions, but they all related to the aliases.

@AgA: It's all about control. I want to control the URLs that Google indexes, and I don't want duplicate content. (Also, clients just don't want to see "node/xxx" anywhere.)

I did find a solution:

  1. Remove the front page from the XML Sitemap. It will be indexed regardless.
  2. Delete any alias for the front page.
  3. In Nodewords settings, select "Use front page meta tags".

The only thing I don't like about this solution is that my site editors can no longer edit any meta tags on the node edit page. Once you select "Use front page meta tags", the only way to change them appears to be on the Nodwords admin pages.

The "Use front page meta tags" is a bit confusing, in that Nodewords was already inserting a canonical tag before I enabled this setting. Also, it's easy to enter tags at admin/content/nodewords/meta-tags/frontpage thinking they will show up on the home page, only to realize that you also have to enable "Use front page meta tags".

Problems solved.

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