1

I recently made my website https and it's previous url (http) had many Facebook likes which I would like to migrate to the new https url. The only change to the url was the https, no domain change or anything else.

I followed the migration steps advised by Facebook but ran into the following errors (according to developers.facebook.com's Open Graph Object Debugger):

Critical Errors That Must Be Fixed.
Could Not Follow Redirect Path.
Using data from https://www.myurl.com because there was an error following the redirect path.

Errors That Must Be Fixed.
Circular Redirect Path.
Circular redirect path detected (see 'Redirect Path' section for details).
Could Not Follow Redirect.
URL requested a HTTP redirect, but it could not be followed.

To find the object, these are the redirects we had to follow.
original http://www.myurl.com
302 https://www.myurl.com
og:url http://www.myurl.com

I have no idea how to fix this. Obviously because of the http to https change I have a 301 redirect from http to https on my .htaccess which I think is what is causing the problem. Any ideas folks?

Update...

It appears like what I need to do is exclude Facebook's crawler (how do I identify that?) from following my http://www.myurl.com to https://www.myurl.com redirect. My .htaccess file looks like this at the moment...

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/contact-us\.php
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}

RewriteCond %{HTTPS} on
RewriteRule ^contact-us\.php http://%{HTTP_HOST}/contact-us.php [NC,L,R=301]

I have http to https redirected with exception of one php page. But how do I exclude Facebook's crawler from automatically going to https?

6
  • As far as I am aware, it is not possible to transfer likes from one URL to another or pass them through a redirect (which is absolutely ridiculous and a huge oversight on Facebook's part). I don't think there are any workarounds whatsoever to this unless you write a custom widget to display like count that adds the old URL and the current URL numbers together and display this. Please post a link to "Facebook's migration steps" as I didn't even know there was a process for this.
    – zigojacko
    Jan 7, 2015 at 9:10
  • 1
    Zigojacko it's here on this page: developers.facebook.com/docs/plugins/like-button near the bottom under "I need to move a page to a different URL - can I migrate the number of likes to the new page location?"
    – Lindy
    Jan 7, 2015 at 16:03
  • Thanks for pointing me to it Lindy. As I thought though, it isn't possible to transfer likes from one URL to another so I stand my original comment. Facebook really should make this possible.
    – zigojacko
    Jan 7, 2015 at 16:23
  • Er it says the number of likes can be migrated "If you move a page to a new URL you can't move the likes directly to the new URL but you can use the old URL as the canonical source for the number of likes at the new URL." This is what I'm trying to do.
    – Lindy
    Jan 7, 2015 at 21:39
  • Yes, but that doesn't migrate likes to a new URL. It tells Facebook to use the likes on the old URL. It's a workaround, and not a great one at best. It's certainly not advisable to set the canonical URL to that of the old URL. Redirecting Facebook's crawler to the old URL would be the best approach but whether that adds any new likes on the new/current URL, I don't know.
    – zigojacko
    Jan 8, 2015 at 8:38

1 Answer 1

1

You need to disable the 301 redirect when Facebook's crawler crawls the site. Jon Lin says on StackOverflow:

This question addresses the user-agent that facebook external hits will look like. You just need to add a condition to check for it:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.