rel =“canonical”之间的差异和og:url? [英] Difference between rel="canonical" and og:url?

查看:295
本文介绍了rel =“canonical”之间的差异和og:url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于搜索引擎和Facebook似乎如何处理这些URL,我无法理解规范的URL。



我的Google地图动态网站允许访问者使用社交媒体要求在他们的国家举行演出。其中一个页面可以在以下网址找到: http://izzy.nogig.in/



当用户点击他们的国家标记时,它给予他们共享选项(twitter / facebook / etc),当共享的选项(twitter / facebook / etc)将专门为该国家分享URL,例如:izzy.nogig.in/usa?还是izzy.nogig.in/spain?等等。



网址中的所有这些国家/地区都有很多重复的内容,所以我使用以下内容将搜索引擎指向我想要排名的页面: -

 < link rel =canonicalhref =http://izzy.nogig.in/_?/> 

对于Facebook喜欢计算每个国家,我设置了我的Open Graphog:url如下所示,例如:

 < meta property =og:urlcontent =http://izzy.nogig。在澳大利亚? /> 

现在,当我通过Facebook对象调试器运行国家/地区的URL(例如http://developers.facebook.com/tools/ debug / og / object?q = http%3A%2F%2Fizzy.nogig.in%2Faustralia%3F )显示如下: -

 响应代码:206 
提取的URL:http://izzy.nogig.in/australia
规范网址:http://izzy.nogig.in/australia

不匹配og:url和canonical url:
og:标头中的url标记与html中rel ='canonical'链接不同的URL。

上面的错误是令我困惑的。我知道他们不匹配,但我认为这是正确的方法。



调试器中的所有内容对我来说都很好(每个国家的链接,描述,图像等),以及我不能更改rel =canonical值来匹配我的og:url,因为我需要它指向搜索引擎的单个页面(国家/地区)。



我相信这一切都正常工作。我应该忽略调试器的错误,还是不正确地设置错误?我不想让每个国家的喜欢都消失,并计入rel =规范的URL。



非常感谢 - 将

解决方案

链接 rel =canonical将被搜索引擎用作 og:url 将被Facebook使用



og:url 基本上告诉FB刮刀忽略此页面上的任何内容,然后再次使用此网址



更多关于Canonical链接元素: a href =http://en.wikipedia.org/wiki/Canonical_link_element =noreferrer> http://en.wikipedia.org/wiki/Canonical_link_element


I'm having trouble understanding canonical URLs with regards to how search engines and Facebook seem to handle them.

My Google maps powered site allows visitors to use social media to request a gig in their country. One of the pages in question can be found at: http://izzy.nogig.in/

When a user clicks on their countries marker it gives them sharing options (twitter/facebook/etc), which when shared will share the URL specifically for that country, eg: izzy.nogig.in/usa? or izzy.nogig.in/spain? etc.

All of these countries in the URL amount to a lot of duplicate content so I use the following to point search engines to the page I want ranked:-

<link rel="canonical" href="http://izzy.nogig.in/_?"/>

For Facebook Likes to count towards each individual country I've set my Open Graph "og:url" as follows, eg:

<meta property="og:url" content="http://izzy.nogig.in/australia?" />

Now when I run a country-specific URL through the Facebook Object Debugger (eg. http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fizzy.nogig.in%2Faustralia%3F) it shows the following:-

Response Code:  206
Fetched URL:    http://izzy.nogig.in/australia
Canonical URL:  http://izzy.nogig.in/australia

Mismatch og:url and canonical url:
og:url tag in the header is not the same URL as rel='canonical' link in the html.

The above error is what's confusing me. I know they're mismatched, but I thought this was the correct way to do this.

Everything in the debugger looks good to me (correct link, description, image etc for each country), and I can't change the rel="canonical" value to match my og:url as I need it pointing to a single page (country-less) for search engines.

I believe it is all working correctly. Should I just ignore the error from the debugger, or have I set this up incorrectly? I don't want "likes" for each country all disappearing and counting towards the rel="canonical" URL.

Many Thanks - Will

解决方案

link rel="canonical" will be used by search engines where as og:url will be used by facebook

og:url basically tells the FB scraper "ignore anything on this page, and scrape this url instead"

More for Canonical link element: http://en.wikipedia.org/wiki/Canonical_link_element

这篇关于rel =“canonical”之间的差异和og:url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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