I migrated my site from http to https and I lost Facebook comments [closed]

-2

I was doing some testing recently on my blogger site and when I turned on https on my site, I lost Facebook comments.

How do I fix this?

    
asked by anonymous 25.08.2018 / 20:32

1 answer

2

According to facebook documentation , it is not possible to move tanned , shares or comments directly to the new URL, but you can use the old URL as the canonical font for the number of tanned or shares in the new URL.

Basic Information

When resolving which URL a tasting or sharing action should be assigned to, Facebook uses a process to resolve the canonical URL of the URL being uploaded. When a URL loads, the crawler searches for:

  • A 301 or 302 HTTP Redirect
  • Using a open graph og: url tag a> on page
  • The use of rel=canonical , as described in RFC 6596 . (The Facebook crawler only supports content, not HTTP headers.)

If any of these methods results in a URL other than the URL originally loaded, the specified URL will be considered the "canonical URL" of the original URL. If necessary, the crawler will follow a chain of redirects to find the canonical URL.

All tastings and shares will be assigned to the canonical URL of the loaded URL.

Examples
  

Tip: Use our debugger to see what Facebook sees when it crawls your page.

By controlling the canonical URL, you can move content from one URL to another and keep tally counts and shares as long as you allow Facebook to continue resolving the new URL in the old one. This can be done with one of two methods:

Add an og: url tag to the new URL pointing to the old URL (Preferred) In your new URL, you must include a link to the old URL. For example, if your new URL had link and the old URL was link , include this excerpt in new-url:

<meta property="og:url" content="https://example.com/old-url" />

In your case , your old url was something like http://foobar.blogspot.com , now it is https://foobar.blogspot.com , so in og:url do this:

<meta property="og:url" content="http://foobar.blogspot.com" />

Using this method tells our crawler that the canonical URL is in the old location, and the crawler will use it to generate the number of tastings and shares on the page. Tanned and new shares will continue to be added to the old URL as well.

This also requires that the old URL still process a document with Open Graph tags and return an HTTP response 200, at least when uploaded by the Facebook crawler. If you want other clients to be redirected by visiting the URL, submit your HTTP 301 response to all non-Facebook crawler clients. The old URL should contain its own og: url tag that points to itself.

  

Learn how to recognize the Facebook crawler in the Sharing Best Practices Guide . p>

This method will also work with rel=canonical , but there is preference for og:url .

Redirect the Facebook crawler to the old URL

Another method of achieving this is to redirect the Facebook crawler to the old URL every time it visits the new URL. Like the method described above, the old URL must be a valid document with Open Graph headers. And if you want to include a redirect in the old URL, the Facebook crawler should not be redirected when you visit the old URL.

    
25.08.2018 / 23:34