Google+ Posts missing images

Written by James McDonald

September 25, 2015

If you have moved from one content management system to another. For example you move from Drupal to Joomla and you have a social media plug-in that posts your articles to your Google+ or Facebook page you might find when you move CMS’s that your social media feed is missing the images.

For google + this is because G+ use a proxy server to request the images from your website when someone views your feed.

So when you move from one CMS to another you tend to break the path to your images.

E.g. drupal plonks images in /sites/default/files and Joomla put them in /images/modulename/perhapsyearame/

So how to fix?

What I do is look in the access.log of apache and then grep out the things that are being requested and returning 404s

e.g. the following gets you all that is being requested but not found by you server

cat /var/log/apache2/other_vhosts_access.log | grep -e '\s404\s' > 404s.log
# also look for (via GoogleImageProxy) in the logs this will tell you that 
# it's a G+ server requesting a missing image

once you have a list of 404s you can then look through and find requests for images and then map them to the new content.

Once you know an old and then a new url you can write Redirect rules to suit.

# put in .htaccess
Redirect 301 /sites/default/files/fallacious_rumours.png /images/blog/2015/fallacious-rumours.png

You can then refresh you G+ feed and watch the missing images re-appear.


Submit a Comment

Your email address will not be published.

You May Also Like…


Zebra Printer Language The above website has a page where you can enter ZPL and it...

PHP Iterators

Just came across a Youtube talk "Iterators in PHP" by Jake Smith published in 2014 that steps through the many...