Facebook Bot

Hi All

We have recently switched our site from http to https via cloudflare.
A big challenge we have are the facebook likes we have on our pages. I have managed to change the meta go:url to the http version of the page however whenever I rescrape the page in facebook developer I am getting a circular reverence -

Error - We could not resolve the [canonical URL] because the redirect path contained a cycle

looking at the Redirect paths the go:url is being redirected from the http to the https and therefore the likes from the http page are not being shown on the https page.

I believe that I am going to have to fix this within cloudflare - I suspect I need to add a rule to NOT redirect from http to https if the user is a facebook bot. However am new to this and am hoping that someone can give me some guidance/direction on how to proceed.

Many Thanks


You cannot set conditional redirects on Cloudflare, unless you use Workers and create a special worker for that purpose.

Without Workers, you’d need to turn off Always use HTTPs (under SSL/TLS > Edge Certificates), as well as any page rules with a Forwarding URL setting, and create equivalent redirects on your origin server.

If you opt to implement a worker, I’d suggest you search here on the Community as well as on Google to see if there isn’t a worker recipe what would help you do what you need.

It’s unfortunate that Facebook is still asking website admins to set an specific og:url for their crawlers, but not for everyone else, as a way to retain likes and other sharing stats.

I wish you success in your task.

This topic was automatically closed after 14 days. New replies are no longer allowed.