Forum Moderators: Robert Charlton & goodroi
Re: Google images. The annoying thing is that Poogle doesn't like to index my pages properly anymore (bitten by supplemental grief lately) but they get my graphics just fine.
I guess some image traffic is better than nothing from G, but I kinda hate them all the same ;-)
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?spaceypeople\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example2\.com/ [NC]
RewriteRule .*\.(jpe?g¦gif¦bmp¦png)$ /alternate-image.png [L]
That checks the referrer and if it's banned it send an alternate image. I have the alternate image in a different folder than the htaccess file protecting the rest of the images so it doesn't get blocked.
To completely block (ie, send a forbidden header and no image at all) I'm pretty sure this is the code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?spaceypeople\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example2\.com/ [NC]
RewriteRule .*\.(jpe?g¦gif¦bmp¦png)$ - [F]
If you just want to block the umm.. spaceypeople, you can remove the second line. Just be sure to change the flag to [NC] for the last, or only line. [NC,OR] is used if you have multiple places (like ebay etc) that you want to block, and [NC] for the final line.