facebook - Open Graph URL 是重定向到页面的永久链接

标签 facebook facebook-like facebook-opengraph

我正在我的网站上添加开放图元标记并测试它是否与 Facebook URL Linter 一起工作。

唯一无法正常工作的是 og:url: 标记,我想在此元标记中添加当前页面的永久链接 url。

永久链接实际上重定向到当前页面。我使用它是因为我的页面 URL 如下所示:http://website.com/photos/243/hello-this-is-the-title/ URL 的最后一部分可以更改为用户,如果更改,则 URL 将更改,并且不会与存储在 Facebook 上的所有“赞”相关联。

这就是为什么我有一个看起来像这样的永久链接页面:http://website.com/permalink/243/,这将重定向到 http://website.com/photos/243/hello-this-is-the-title/,这样 Facebook 上的所有点赞都与永久链接相关联,而不是与另一个链接相关联。

当我使用 Facebook URL linter 时,它告诉我有一些严重错误需要修复 - 检测到循环重定向路径(有关详细信息,请参阅“重定向路径”部分)。

我不知道我想做的事情是否可行。但在这里我真的需要一点帮助。

最佳答案

This is why I have a permalink page that looks like this : http://website.com/permalink/243/ and this will redirect to http://website.com/photos/243/hello-this-is-the-title/, so that all the likes on Facebook are associated with the permalink instead of the other one.

When I use the Facebook URL linter it tells me that there are some critical errors that need to be fixed - Circular redirect path detected (see 'Redirect Path' section for details).

两种选择:

  • 通过查找用户代理 ( details ) 将 Facebook 抓取程序排除在重定向之外。

  • 不要在服务器端重定向,而是通过 JavaScript 在客户端重定向。 (爬虫不关心 JavaScript。)

关于facebook - Open Graph URL 是重定向到页面的永久链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12491969/

相关文章:

php - 将图像发布到预定义页面上的相册

tabs - 像按钮行为这样的新时间线

重新加载后 Facebook 签名请求为空

facebook - 未提供 'og:title' 类型的必需属性 'string'

c# - Entity Framework 添加或更新

ruby - Facebook 图形 API 和操作链接

javascript - Facebook 喜欢盒子流

javascript - 我如何告诉 Reddit 忽略我的缩略图 Logo ?

ios - 覆盖 UIActivityViewController 以切换到 Facebook 应用程序(用于 Open Graph 故事)

facebook - 通过API调用删除FB相册