Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   General Business Knowledge (http://www.greenguysboard.com/board/forumdisplay.php?f=10)
-   -   Htaccess that allows Google & Yahoo images? (http://www.greenguysboard.com/board/showthread.php?t=17844)

Ms Naughty 2005-03-23 05:51 AM

Htaccess that allows Google & Yahoo images?
 
It's mentioned in another thread but I thought I'd start a new one.

Can someone post a htaccess that allows Google and Yahoo images to find and use your pics, but doesn't let the Fuskers and others in?

Thanks :)

Jel 2005-03-23 05:54 AM

Hi Grandma Scrotum,
add
RewriteCond %{HTTP_REFERER} !^http://(www\.)?google.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yahoo.com.*$ [NC]

Into your htaccess and you should be good to go :)

DarkEmber 2005-03-23 05:55 AM

you can block all hotlinking and allow google and yahoo (and your domain(s) ) to be simple...plug in what you want at htaccesstools.com

Jel 2005-03-23 05:58 AM

whoops, not to clear there, should have posted this one:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?google.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?Googlebot-Image*$ [NC]


RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.yourdomain.com/hotlink/hotlinkimage.jpg

Then you need to put a seperate htaccess inside your special hotlinking folder that will allow the hotlinking of THAT image:

RewriteEngine on
RewriteRule ^.*$ -

Hope that helps :)

Jel 2005-03-23 05:59 AM

Or you can do it the easy way like what DarkEmber said :D

Ms Naughty 2005-03-23 06:04 AM

Thanks :D

cd34 2005-03-23 11:17 AM

actually, that won't work completely.

You have to take into account that google uses images.google.com.

Then you have to consider that they also use images.google.ca, and images.google.fr, etc.

Then you decide, hey, I'll just add 'google' to the list, and fusker starts using google.fusker.com or fusker.com?google.php.

Its a never ending battle.

Also, to my knowledge, I haven't seen any google sites with Googlebot-Image in the hostname -- that looks more like a UserAgent. Since their robots don't send referrers, and that doesn't look like something that would be in the referrer, I think that line might not be needed. I could be wrong. Happens a lot.

Barron 2005-03-23 03:41 PM

A little tip ;)

You want Google and Yahoo to show thumbs. You dont want google and yahoo showing large pics. You dont what google and yahoo showing the html.

Lets see who figures out why first : )


-

Cleo 2005-03-23 03:51 PM

Over the years I've looked at my stats to see what IPs and domains are sending me traffic.Then I'll go looking at ones in question and sometimes add them into my good list.

To avoid fuckers like fusker I don't use wildcards in my htaccess so I end up with this really big messy htaccess with way too many lines but my server seems ok with this so who am I to argue with it.

Here are a few lines from mine.
RewriteCond %{HTTP_REFERER} !^http://216.239.57.104*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://216.239.57.104/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://216.239.57.104:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://216.239.57.104:80.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.alexa.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://alexa.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://alexa.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.alexa.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://alexa.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.alexa.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://alexa.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.alexa.com:80.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.images.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.google.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.google.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.google.com:80.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com:80.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com:80.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com:80.*$ [NC]

Ms Naughty 2005-03-23 07:32 PM

Thanks Cleo
I originally asked this because I've stumbled across older sites where I forgot to put htaccess on it, and was getting traffic from Google Images. I had thought it would be nice to keep getting that traffic, while still using htaccess.

Obviously google images does have it's limitations. I could create a separate folder with "googleable" images in it, but I was just looking for a quick thing to whack into the main pics folder.

Barron, are you talking about the way google loads the whole image as a thumb, or the way it loads the original page in a frame?

Perhaps I should start separating out my thumbnails into a separate folder and allowing google to use that?

Jel 2005-03-24 01:31 AM

Glad to say I've learned something too here :)
Thanks for that code Cleo, nice one.
cd34, yeah you're probably right, I saw it in my stats way back when I first done my htaccess, and was even greener than I am now, and of course, it shows up in the robots not the referrers :D

Fonz 2005-03-24 04:34 AM

Quote:

Originally Posted by DarkEmber
htaccesstools.com

That site has some pretty useful tools :)


All times are GMT -4. The time now is 09:51 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc