I understand the og:url
meta tag is the canonical url for the resource in the open graph.
What strategies can I use if I wish to support 301 redirecting of the resource, while preserving its place in the open graph? I don't want to lose my likes because i've changed the URLs.
Is the best way to do this to store the original url of the content, and refer to that? Are there any other strategies for dealing with this?
To clarify - I have page:
/page1
, with an og:url
of http://www.example.com/page1
I now want to move it to /page2
, using a 301 redirect to http://www.example.com/page2
Do I have any options to avoid losing the likes and comments other than setting the og:url
meta to /page1
?
Click Use My Domain on the domain you want to connect to your Facebook page. Click Connect to an Existing Site. Select the Facebook option under the Social Sites section. Type in your Facebook URL, which you can find in the General Account Settings on your Facebook page.
Worst of all, you can't add a redirect. That's right; there is no way by default to direct a user from one Facebook page to another automatically. If you change your Username or URL, and someone visits the old URL, they hit a 404 page. That's it, end of story, nothing you can do.
To redirect a site permanently, one should use a 301 redirect. This type of redirect is best for SEO purposes and also informs the search engines that the site has moved permanently. If you change your domain name and want to point to a different URL, a 301 redirect is your best choice.
Short answer, you can't.
Once the object has been created on Facebook's side its URL in Facebook's graph is fixed - the Likes and Comments are associated with that URL and object; you need that URL to be accessible by Facebook's crawler in order to maintain that object in the future. (note that the object becoming inaccessible doesn't necessarily remove it from Facebook, but effectively you'd be starting over)
What I usually recommend here is (with examples http://www.example.com/oldurl
and http://www.example.com/newurl
):
http://www.example.com/oldurl
if the request comes from the Facebook crawler. Thus:
If you're moving a lot of URLs around or completely rewriting your URL scheme you should use the new URLs for new articles/products/etc, but you'll need to keep the redirect in place if you want to retain likes, comments, etc on the older content.
This includes if you're changing domain.
The only problem here is maintaining the old URL -> new URL mapping somewhere in your code, but it's not technically difficult, just an additional thing to maintain in the future.
BTW, The Facebook crawler UA is currently facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With