:: detour to own htaccess ::
RewriteCond %{HTTP_REFERER} !^http://www\.example\.com/
RewriteCond %{HTTP_REFERER} !^-?$
RewriteCond %{HTTP_REFERER} !google
RewriteCond %{HTTP_REFERER} !translate
RewriteCond %{HTTP_REFERER} !\w+\.bing\.com/images/
RewriteCond %{HTTP_REFERER} !search\.yahoo\.com
RewriteCond %{HTTP_REFERER} !images\.yandex
RewriteRule \.(png|jpe?|gif)$ /pictures/hotlink.png [L]
The exact list of authorized referers is a matter of personal choice. Mine includes a couple of forums where I personally might have posted an image that lives on my site. Each site's htaccess also names the other sites. You definitely have to list two things: the canonical form of your own sitename,
and blank. (In addition to search engines, some browsers don't send a referer.) My list is pretty generous.
If you don't want your pages to come up in image search, or in page translations, I'd use a different approach:
RewriteCond %{HTTP_REFERER} !\w+\.bing\.com/images/
RewriteCond %{HTTP_REFERER} !search\.yahoo\.com
RewriteCond %{HTTP_REFERER} !images\.yandex
RewriteCond %{HTTP_REFERER} !translate
RewriteRule \.(png|jpe?|gif)$ /pictures/smallgifs/onedot.gif [L]
That's your ordinary administrative gif: 1x1 pixel, transparent. Put that part
before the anti-hotlinks part. Then, still earlier, you have a line that says something like
RewriteRule (hotlink\.png|onedot\.gif) - [L]
so nobody goes around in circles.
No, I don't know why it says \w+\.bing. There's probably some historical reason; I've just never changed it. Just the other day I made the slightly horrifying discovery that the "opt-out" section of my legal page displays the NO HOTLINKS image where it should be showing a bit of piwik text inside an iframe. Had to do with some careless cut-and-paste work after the site move. Fixed now, but how awful for the visitor!