Topic-icon Wrong image when sharing website link on Facebook

Active Subscriptions:

None
Is there opengraph image support in JFBConnect? I would like to be able to set a standard image that displayed when I post a link to my website on Facebook.

Thanks

Dave
The topic has been locked.
Support Specialist
12 years 2 months ago #42629 by alzander
Dave,
Yes, JFBConnect has a lot of support for Open Graph tags in general.

In the JFBConnect -> Open Graph area, go to "Configuration". In there is a "Defaults" box. You can set a default image for all pages on your site (like a logo) by adding the following:
image=http://yoursite.com/link-to-a-good-image.jpg
Then, if you enable the Open Graph plugins for any extensions your using (Joomla content, jReviews, K2, etc), JFBConnect will try to automatically select a better image (from the articles text, settings, etc).

You can also, on any page, add the following tag:
{SCOpenGraph image=http://yoursite.com/link-to-best-image.jpg}

I hope that helps explain, but if you have other questions, just let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago - 12 years 2 months ago #42636 by fridayshoes
Hi, thanks for the answer.

I tried the 1st option, which now shows the correct image in the FB Opengraph debug tool, however when I try to post the link on FB it only picks it up if the link is written mbro35.co.uk and not when www.mbro35.co.uk is used

I noticed there is still an error message in FB Opengraph debug tool and wondered if this is causing the problem.

Open Graph Warnings That Should Be Fixed
Mismatch og:url and canonical url og:url tag in the header is not the same URL as rel='canonical' link in the html.

Hope you can help

Thanks
Last edit: 12 years 2 months ago by fridayshoes.
The topic has been locked.
Support Specialist
12 years 2 months ago #42664 by alzander

Open Graph Warnings That Should Be Fixed
Mismatch og:url and canonical url og:url tag in the header is not the same URL as rel='canonical' link in the html.

That's happening because there is a canonical link tag in your header that states your home page URL is always the non-www version. JFBConnect also inserts an og:url tag for the 'current' page which will contain the www. when you are viewing your page on the www site.

I'd honestly recommend setting up a standard .htaccess redirect for your site to rewrite any requests to www to strip the www. That's better from an SEO standpoint and will prevent these types of issues since www. will no longer be accessible. If you need help with this, just let me know.. but google has plenty of info on htaccess www redirections as well :)

The reason the image won't work when posting it as www. on Facebook is the same reason. Facebook has already cached values for the www version from some time in the past. Since www. has a canonical link pointing somewhere else now, there's no way for Facebook to refetch the values properly for the www. version. Eventually, Facebook will give up trying to get the www. tags and will trust your canonical link, but that's a longer process since they know they saw tags for the www. site at some point in the past.

It's confusing, I know, but I hope that all makes sense.

As always, let us know any questions you may have!
Alex
The topic has been locked.
Active Subscriptions:

None
Cool thanks, I added this to my .htaccess file

RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain\.com
RewriteRule (.*) domain.com/$1 [R=301,L]
The topic has been locked.
Support Specialist
12 years 2 months ago #42688 by alzander
That should do it.. of course, assuming you changed domain.com to your domain :)

Hope that helps with everything. As always, should you need anything else, just let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago - 12 years 2 months ago #42699 by fridayshoes
The modification to the .htaccess file worked but I've still got an issue.

1. The FB debug tool still reports the following: Mismatch og:url and canonical url og:url tag in the header is not the same URL as rel='canonical' link in the html.

Is there a reason why I'm getting this still?
Last edit: 12 years 2 months ago by fridayshoes.
The topic has been locked.
Support Specialist
12 years 2 months ago #42707 by alzander
Those 2 are the same on your home page. Can you let me know what page you're testing with where it's different?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None

alzander wrote: Those 2 are the same on your home page. Can you let me know what page you're testing with where it's different?

Thanks,
Alex

Yes that is correct, I'm just wondering why the FB debug is reporting that error. I've not been testing any particular page, just www.mbro35.co.uk and mbro35.co.uk
The topic has been locked.
Support Specialist
12 years 2 months ago #42724 by alzander
I'm not seeing the message you mention. When I try to debug the www. version, it shows:

Response Code 200
Fetched URL www.mbro35.co.uk/
Canonical URL mbro35.co.uk/

That's correct since you have a redirect now.

On the non-www version, it just shows the results as expected.

I hope everything is settled now for you as well, but if you're still seeing errors, just let me know.

Thanks,
Alex
The topic has been locked.