开发者

Canonical OG URL fails in URL linter because of redirect

开发者 https://www.devze.com 2023-04-11 11:08 出处:网络
I recently changed domain name for my site and migrated my content. Most URLs from the old site use a 301 redirect to the new site, as you would guess.

I recently changed domain name for my site and migrated my content. Most URLs from the old site use a 301 redirect to the new site, as you would guess.

In an effort to retain FB like and comment data, I kept the og:url property set to the old URL, since it is the original and canonical identifier in Open Graph. I implemented in August, and it was working properly,开发者_运维技巧 with previous like data retained. Now it is not working and showing previous like data, and fails in the URL Debugger.

Here is an example from the new site:

http://seattle.findwell.com/million-things-to-do-seattle/washington-brewers-festival-2011

In URL Debuggger, it now returns this error:

There was an error in fetching the object at URL 'http://seattle.findwell.com/million-things-to-do-seattle/washington-brewers-festival-2011/', or one of the the URLs specified via a redirect or the 'og:url' property including one of http://www.hometalkin.com/seattle/million-things-to-do-seattle/washington-brewers-festival-2011/.

Nothing has changed in my OG tags. Has something changed with canonical URL in open graph that causes it to fail when a redirect is in place?


This page:

  • http://seattle.findwell.com/million-things-to-do-seattle/washington-brewers-festival-2011

has this og:url:

<meta content="http://www.hometalkin.com/seattle/million-things-to-do-seattle/washington-brewers-festival-2011/" 
      property="og:url" />

but when you actually go to (in fact - when Facebook crawler tries to go to) this URL from og:url the site redirects you back to:

  • http://seattle.findwell.com/million-things-to-do-seattle/washington-brewers-festival-2011/

This is a circular reference.

In order to fix it you need to change your og:url to:

  • http://seattle.findwell.com/million-things-to-do-seattle/washington-brewers-festival-2011/


I actually had a very difficult time with this when I was first starting out as a developer.

I made a tool for this exact purpose -- as I thought it might be helpful to others:

Facebook/Open Graph Like Button Generator

It generates (and stores) the open graph tag(s) so you don't need to put them in your page and the 'Redirect URL' tells it where to send all the traffic.

It detects the Facebook bot/scraper too so it won't interfere with anything :)

Good luck


I had exactly the same problem. I have changed my website url and I have over 40.000 radios with fb likes and comments.
Example:

http://www.radioways.com/fr/radio/nrj.html
to
http://www.radioways.fr/radio/nrj.html

I spend days and days reading and checking the forum and I did not find the answer...
Here is what to do:
1. In the og canonical, you need to put your old website url
2. In the Iframe url, you can put both. The result of the likes, will be the addition of the likes of the ogcanonical + the likes of the Iframe
An this will not work (and this is why I spent so much time USELESS) untill you validate those setup with FB

Best regards.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号