我如何修复facebook循环重定向


How do I fix facebook circular redirect?

我在一个网站http://www.getyogi.fr/上做了4个登陆页,然后用php脚本随机化了不同的登陆页。

但我的问题是修复开放的图形facebook。他返回:无法遵循重定向路径-使用来自http://www.getyogi.fr/lp1/的数据,因为在重定向路径之后出现错误。

这是我打开的图形HTML:

<meta property="og:title" content="Le yoga en ligne">
<meta property="og:site_name" content="GET YOGi">
<meta property="og:url" content="http://www.getyogi.fr/">
<meta property="og:description" content="GET YOGi est un site pour pratiquer le yoga en ligne et prendre soin de vous où et quand vous voulez. Depuis votre mobile, votre tablette ou votre ordinateur, des cours HD disponible 24H/24, 7 jours /7.">
<meta property="fb:app_id" content="677363099034751">
<meta property="og:type" content="website">
<meta property="og:image" content="http://www.getyogi.fr/lp1/img/yoga1.jpg">

有人能帮我吗?

这里的问题是因为您在og:url中使用的URL。你说你有一段PHP,它随机化了一个登陆页面,然后将用户重定向到那个页面。下面是发生的事情:

  1. 爬虫转到https://your-url.com/
  2. PHP生成一个登陆页面并将爬虫重定向到https://your-url.com/landing-page-1
  3. 在登陆页面1,爬虫看到og:url是https://your-url.com/,这被认为是规范的URL,所以爬虫然后到那里
  4. 现在我们被困在步骤2和& &;3

你可以在这里做几个选择:

选项1:在你的登陆页面有og:url是用户登陆页面的URL。

选项2:主URL上的让您的随机PHP脚本忽略来自Facebook爬虫的请求,该爬虫具有facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)

的用户代理

我也有这个错误消息,但原因完全不同。我通过在语言属性(在标题中)添加OpenGraph来解决错误

例如:

<html xmlns="https://www.w3.org/1999/xhtml" xmlns:og="https://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">