Html 规范URL的使用
我正在尝试设置og标签,以便在Facebook上共享我的子页面 我的子页面的URL是:www.example.com/subpage.html Facebook的代码:Html 规范URL的使用,html,facebook,url,meta,canonical-link,Html,Facebook,Url,Meta,Canonical Link,我正在尝试设置og标签,以便在Facebook上共享我的子页面 我的子页面的URL是:www.example.com/subpage.html Facebook的代码: <meta property="og:title" content="some text"> <meta property="og:type" content="website"> <meta property="og:url" content="http://www.example.com/sub
<meta property="og:title" content="some text">
<meta property="og:type" content="website">
<meta property="og:url" content="http://www.example.com/subpage.html">
<meta property="og:image" content="www.example.com/subpage.html/images/image1.jpg">
<meta property="og:site_name" content="some text">
<meta property="og:description" content="some text">
<meta property="og:image:width" content="470">
<meta property="og:image:height" content="246">
我还使用了一个规范的url,它是:
<link href="http://www.example.com" rel="canonical">
所以我的问题是:property=“og:url”是否应该与canonical相同?
如果我在FacebookURL调试器上测试它(如上),那么它将获取正确的信息。但它给了我以下警告:
标题中的og:url和规范url og:url标记不匹配与html中的rel='canonical'链接的url不同。
如果我改变它,并使其与canonical相同,那么它将获取用于我的主页的信息,而不是用于子页面的信息,这是我不想要的
那么,我必须保持原样吗?调试器只是遵循约定。规范url不应该指向其他页面,除非它们共享相同的内容。我把它简单化了
网上有很多关于这方面的资料。例如文章。为什么要将主页URL用作子页面的
canonical
URL?