Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a PHP application which has a "Share on Facebook" button that,

  • On the development server shows the thumbnail images correctly and allows the user to select between them

  • On the live server, it does NOT show the thumbnail images at all.

The relevant portion of the .htaccess file is:

# Set up caching on media files for 2 days
<FilesMatch "\.(gif|jpg|jpeg|png|flv)$">
ExpiresDefault A172800
Header append Cache-Control "public"
</FilesMatch>

I'm using the exact same set of php files and .htaccess, but the server configuration is different.

What could be causing this? Note that the text appears fine.

Edit1

We are also doing some URL rewriting related to images in the .htaccess (on both servers):

...
RewriteRule ^.*/content/image/(.*)$ content/image/$1 [L]
...
RewriteRule ^.*/images/(.*)$ images/$1 [L]
...

Would that be somehow making a difference? Images appear fine all throughout the site.

(I posted this question earlier as http://stackoverflow.com/questions/4142597/share-on-facebook-does-not-show-thumbnail-images) )

share|improve this question
    
Can you view source on both servers and see if the paths are being re-written differently? –  digit1001 Dec 28 '10 at 16:06
    
In addition to @Don's tip have you tried using Live HTTP Headers or Tamper Data (Firefox) or something like Charles Web Debugging Proxy to see what Facebook is actually requesting from both sites? –  Hissohathair Feb 14 '11 at 13:27

2 Answers 2

up vote 1 down vote accepted

The reason why Facebook does not show the thumbnail is because it cannot fetch it. Why not try testing it once without the URL rewriting?

share|improve this answer
    
thanks - it started working after i removed the url rewriting bit –  matt74tm May 7 '11 at 6:39

Try testing using facebook's URL linter.

http://developers.facebook.com/tools/lint/

Make sure Facebooks bot can access the page. 

Try implementing the open graph protocol to asset facebook in choosing an image.

Also, keep in mind that facebook caches pages for a period of time, if the linter is working but images are still no showing when using like and share this could be the problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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