The result: Search engines show a self hosted version of your image instead of your hotlinked image.
The problem: A visitors browser remembers not being allowed to view the image so if they view the site directly at a later date the image remains hidden. This is not a caching issue, if you have properly set browser cache control to cache images then the browser remembers the error.
Condition: This only happens if a visitor clicks on the "Full Sized image" link or the "Website For This Image" link in the sidebar. It does not happen if they click on the x in the corner of the image shown by Google.
If anyone has solved this issue I'd love to hear it. If you'd like to test it remember that you need to clear your cache before visiting Google otherwise your browser will remember the image and show it properly which is not what a new visitor will experience.
Ideas on how to solve this or why it only happens when the visitor clicks the links and not the x beside the image?
Msg#: 4529719 posted 7:57 pm on Dec 19, 2012 (gmt 0)
update: I forgot to mention, the above happens when using X-Frame-Options SAMEORIGIN to block sites from framing your site, which image search also does. The hotlink protection doesn't cause the same issue without the X-Frame-Options being set.
Time to whitelist Google hotlinking or is there another solution that avoids visitors from being blocked on your own site?
Msg#: 4529719 posted 9:20 pm on Dec 19, 2012 (gmt 0)
Huskypup, your code whitelists the search engines to hotlink your image. If you use the code you provided, minus the whitelisting, and ALSO have the X-Frame-Options SAMEORIGIN set in headers to prevent your site being framed, then the visitor cannot see the image if they click on Google's "view full size" link or "Website for this image" link(they can if they just click the x in the top right corner of the image, the problem occurs with the links). The visitor's browser(Firefox) apparently picks up the block and their browser cache serves up a broken image even when they are on your site afterwards, unless you do not allow browser caching of images(which you should).
I was *hoping* for a way that still blocks the search engines from hotlinking but without resulting in a visitor browser being unable to see the image even if they visit your site afterwards. Getting rid of the X-Frame-options sameorigin is not an option.
Remember: If you block search from hotlinking they will still show your image but will use their own cache copy instead of your original. That stops hotlinking even more. Let the scrapers hotlink Google's copy of your images if they want... it makes for a much quicker trip out of the serps for the scraper.
I'm looking for this solution because I don't even want the image url on the scraper site, some of my images are being hit by Google's new safesearch approach (off or explicit only, there is no more moderate on .com). Hotlink protection alone wasn't enough to disassociate my image from the content on the scrapers site, just having a non-adult image url on an adult site is apparently enough to cause that image some rating issues.
I hope that better explains the problem. This *feels* like something Google would have to fix on their end.
edit: huskypup, using your code, if you also prevent the framing of your site on other sites using an X-Frame-Options SAMEORIGIN header the visitors who see your images on google.ca (or any other country) will have the problem I'm describing.