合并社交媒体计数器的基本 URL 和索引页(Facebook、Twitter、Plus1)
寻求帮助,以连接社交媒体计数器对基本 URL 的点赞数和基本 URL 与文件名的计数方式。
我在网站的不同故事页面上有三个计数器(Facebook 点赞、Plus1 点赞和推文)。所有这些页面名称当前均为index.shtml。在我的编码中,我始终将这些页面称为“/programs/mystory/”而不是“/programs/mystory/index.shtml”。然而,无论如何,有些人还是设法到达了index.shtml 地址。使用 Open Graph 元标记,我可以指示要点赞的 url。但是,如何使计数在基本 URL 喜欢和基本 + 索引之间互换?
实例:
这两个 URL 访问同一页面: http://being.publicradio.org/programs/2011/mormon-demystified/
http://being.publicradio.org/programs/2011/mormon-demystified/index.shtml
但是,如果您从第一个 URL 查看该页面,您会看到 543 个 Facebook 点赞,< strong>8 加 1 个赞,以及 32 条推文。如果您从第二个 URL(包含文件名)查看它,您会看到 0 个 Facebook 点赞、1 个加 1 个点赞和 0 个推文。无论 URL 是什么,当您查看此页面时,我希望您看到 543 个 Facebook 点赞、9 个加 1 个点赞和 32 条推文。
有人可以帮忙吗?提前致谢!
Looking for help in connecting the way social media counters count the likes on a base URL and the base URL with file name.
I have three counters (Facebook likes, Plus1 likes, and Tweets) on different story pages on my site. All of these page names are currently index.shtml. Within my coding, I am consistent at referring to these pages as "/programs/mystory/" rather than "/programs/mystory/index.shtml." However, some people manage to make it to the index.shtml addresses anyway. Using the Open Graph meta tags, I can indicate the url to be liked. However, how do I make the count interchangeable between base URL likes and base+index?
Live example:
These two URLs go to the same page:
http://being.publicradio.org/programs/2011/mormon-demystified/
http://being.publicradio.org/programs/2011/mormon-demystified/index.shtml
However, if you view that page from the first URL, you see 543 Facebook Likes, 8 Plus 1 Likes, and 32 Tweets. If you view it from the second URL (complete with file name) you see 0 Facebook Likes, 1 Plus 1 Like, and 0 Tweets. Regardless of the URL, when you look at this page, I want you to see 543 Facebook Likes, 9 Plus 1 Likes, and 32 Tweets.
Can anyone assist? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
始终使用较长版本的 URL。请务必将其放置在 OG 标签、规范链接参考以及硬编码插件中的 data-href 中。
Always use the longer version of the URL. Be sure to place it in the OG tags, canonical link reference as well as hard-coding the data-href form the plugins.