Re: Is Google Images Worth It Anymore?
Then why not do the same thing as them in reverse?
1 Create a sub domain to use as your CDN. For example http://cdn.example.com/
2 Under that CDN set the following mod_rewrite rules
The only hits to this CDN will be Bots. If the request isn’t from a bot (Image search results) provide a watermarked image via script.php
RewriteCond %{HTTP_USER_AGENT} !(bot|crawler|spider|slurp|pinterest|facebook|feedfetcher) [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.example\.com
RewriteRule ^(.*)\.(gif|jpg|png|flv|mpg|m4v)$ /script.php?image=/real-path/$1.$2 [L]
If it is in fact a bot lets provide them with the actual image by linking to the original via mod_rewrite. We want the bot to see the real image so it can create thumbnails of them but not know the real location of the image
RewriteRule ^(.*)\.(gif|jpg|png|flv|mpg|m4v)$ /real-path/$1.$2 [L]
You can watermark the images on the fly by a GD-supported PHP script as referenced here https://forums.digitalpoint.com/threads/new-google-images-and-traffic.2630989/page-4#post-18434192. I called this script script.php in the above rewrite rule.
3 On your main site you have two options to get these new URLs indexed.
A. Update your scripts to detect bots and have it rewrite the image URLs to the CDN URLs. Just like FanShare except in reverse.
or
B. Using mod_rewrite check user agents and if it’s a bot requesting an image do a 301 redirect to the CDN. I’m not sure how effective this second option will be but based on this article it appears to me a 301 redirect tells them not to use the original URL: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=93633
RewriteCond %{HTTP_USER_AGENT} (bot|crawler|spider|slurp|pinterest|facebook|feedfetcher) [NC]
RewriteRule ^(.*)\.(gif|jpg|png|flv|mpg|m4v)$ http://cdn.example.com/$1.$2 [R=301,NC,L]
I think the above would alleviate the problem by migrating all the bots information over to the CDN. This will allow you to keep your current mod_rewrite rules in place on your main site due to legitimate traffic linking to your root site now.
RewriteCond %{HTTP_REFERER} !^$
PS. I haven’t tested these mod_rewrite conditions. I’m just providing them to give you the basic idea.
PSS. If you implement the above this will only do two things. Provide bots with access to the real images at the CDN URL for (for thumbnail creation) and provide visitors of those bots sites with watermarked images. If you want to redirect those visitors from the watermarked image to the actual page the image is on it gets a little more complicated but not to much.
-
This will only work if you have referrer information. It’s not 100% full proof but it will capture a pretty decent sized amount of traffic and redirect to the page you want. Those it doesn’t catch get nothing more than the watermarked image which I would assume would have your URL on it
-
It will require more mod_rewrite rules under the CND that watch the RewriteCond %{HTTP_REFERER}. For example if someone clicks on the link to view an image within a Google search your server will see this tag “source=images” within the referrer. Once you have that info you pass the image requested off to a script that searches your database for the image and returns the page containing that image instead of the image.
I can get into Step #2 in more detail if you want to get that advanced.
Hope this has helped.
Sincerely,
Kevin.