I feel like a complete free-loader asking you guys yet another coding question but I assure you I have tried to do this without help but clearly need a little push in the right direction and you're always so helpful it's difficult to resist. ;-)
I want
Face
Book to be permitted to use only the image I designate as a thumbnail in FB mail, etc. They've recently used images which are completely unrepresentative of my site.
I tried using <meta property:"og: ....> tags (
despite the fact they break validation) but they don't appear to be working completely as one or two images other than the specified are being used.
Does FB cache your images? If so, this may be why certain images other than that which I've specified are being used from a recently scraped page. If not, then my code clearly isn't working. I also tried using robots to Disallow 'facebookexternalhit' from my image directory and only permitting it to use one image, via the ^above meta tags, from a designated folder, but I then realised that of course FB doesn't respect robots!
So I'm considering using htaccess to force a specific image upon FB when they request one. I have been playing with the following code, bundled together from snippets of other rules, but as yet it does not appear to be working.
Pointers very much appreciated.
Thank you in advance.
# PERMIT FACEBOOK TO USE ONLY THE DESIRED IMAGE
RewriteCond %{REQUEST_URI} ^.*\.(jpe?g|gif|png)$ [NC]
RewriteCond %{REMOTE_HOST} ^https?://(www\.)?facebook\.com(/)?.*$ [NC,OR]
RewriteCond %{REMOTE_HOST} ^https?://(www\.)?tfbnw\.net(/)?.*$ [NC,OR]
RewriteCond %{REMOTE_ADDR} ^66\.220\.146\. [NC,OR]
RewriteCond %{REMOTE_ADDR} ^69\.63\.181\. [NC,OR]
RewriteCond %{REMOTE_ADDR} ^69\.171\.2 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^facebookexternalhit [NC]
RewriteRule .*\./dir/image.png [F]