问题原文
原帖链接 · Ravi Maniyar · CC BY-SA 3.0
For example, if there is an online shopping websites with thousands of small thumbnails of products and when you click over them it shows actual retina/full HD image over a popup. In this scenario, how we can ensure that Google or other bots should crawl only the retina/HD image and not the thumbnail when someone searches in Google images?
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 3.0
Link the thumbnails to the images for users that don't have JavaScript enabled. Like this:
<a href="full-image.jpg"><img src="thumb-nail.jpg"></a>
As long as users can see the full image by clicking, you can disable the click event on the link using JavaScript without incurring a penalty from Google.
Google treats links to images the same as actually having the full image in the page itself. Linking will get the full image to rank in image search and associate it with the correct page on your site.
You could also add a header to the thumbail images that prevents Google from indexing those:
X-Robots-Tag: noindex
If you have the Apache server you could use a directive in .htaccess like:
<FilesMatch ".*thumb.*\.(gif|jpg|jpeg|png)$">
Header set X-Robots-Tag noindex
</FilesMatch>
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
