Allow only certain images size to crawl with .htaccess

kirret
kirret used Ask the Experts™
on
Hey guys

I have blocked all images on my site from Google but my traffic has dropped a lot now. As I use both thumbnails and full size images, is there a way to allow ONLY thumbnails to be indexed using .htaccess or any other way.
Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
This is my current .htaccess code:

RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mywebsite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?google\.(.+)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?(.*\.)?google\.(.+)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?bing\.(.+)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?(.*\.)?bing\.(.+)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yahoo\.(.+)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?(.*\.)?yahoo\.(.+)/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
Most Valuable Expert 2011
Top Expert 2016

Commented:
I guess the overarching question is why have you blocked all images on the site from Google?  What do you hope to achieve by doing this?

What is the URL of the site?

Author

Commented:
This is the site here:
It's www dot rabies white labelz dot com.
It's a membership site where only members can download full size DVD labels, visitors can only access thumbnails. If I didn't have this code in my htaccess file then all sizes of labels were accessible on Google Images which isn't good for our membership.
Most Valuable Expert 2011
Top Expert 2016

Commented:
I'm guessing that you're using client authentication to determine who is a member, maybe something like what is described in this article.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391-PHP-login-logout-and-easy-access-control.html

Using the techniques shown there, you could write a small PHP script that would serve the images.  It could use the access_control(TRUE) test to determine if the client was a member (signed in to the site).  With that information, the PHP script could watermark the images.  Please see the design pattern in this article for an example.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_10065-Adding-a-Watermark-to-an-Image.html

Author

Commented:
Well, that's way too complicated, and I already have a system what handles all payments and client registration - s2Member.
I guess there is no way to filter then which image sizes are getting indexed by Google and which one's won't...
But thanks for your input.
Most Valuable Expert 2011
Top Expert 2016
Commented:
I believe that Google obeys robots.txt with respect to image files, so if all you want to do is keep them away from Google it should be pretty easy.

Payments and client registration are not the same things as protecting your images.  These are separate processes.  The same principles that are used to watermark the images can be applied to "protect" the images.  Namely, serve the images via a PHP script instead of an HTML link to the image file.  It's not hard or complicated and it works; it just takes a little effort to move the images to a safe (not URL accessible) directory.

All that said, however, once you have served a clear image to a client, you have lost control of it forever.  The client can republish it, post it on facebook, make billboards, etc.  There is no technological way to stop that.  Maybe TinEye is your friend.

Author

Commented:
Not really the answer I was looking as this is way more complicated than I was hoping. It maybe well be the only way but I'm not going to try it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial