在Facebook中发布链接时选择随机文章

时间:2018-01-17 19:38:41

标签: php html html5 facebook

我的想法是当我在Facebook上的评论中写我的网站时:

www.mywebsite.com

它会自动生成我之前上传的随机图片和标题。但问题是,当用户点击该图像时,他会将他带到普通网站,而我想要的是将他带到相关文章。这就是我的尝试:

<meta property="og:title" content="This is an article" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://mywebsite.com/articleRelated" />
<meta property="og:image" content="http://mywebsite.com/images/ssz.jpg" />
<meta property="og:description" content="This article about dogs" />
<meta property="og:site_name" content="Random Articles"/>

用户点击时,Facebook将其重定向到mywebsite.com而不是mywebsite.com/articleRelated

1 个答案:

答案 0 :(得分:0)

只要您发布指向www.mywebsite.com的链接,用户将被重定向到此网站,而不是其中一篇文章(www.mywebsite.com/articleRelated)。

您可以将www.mywebsite.com重定向到随机文章。但在这种情况下,你无法知道用户在Facebook上看到的随机文章。