Forum Moderators: open

Message Too Old, No Replies

How come my site's images in google cache are broken?

         

Jessica

10:45 am on Aug 24, 2003 (gmt 0)

10+ Year Member



When I check out the cached version of my site all the images are broken (i.e. they do not display).
Could it be because of the .htaccess file (i got hotlink protection in there) ?

Please advise.

mayday9

12:22 pm on Aug 24, 2003 (gmt 0)

10+ Year Member



yes, that's it. hotlinking protection. There's a way to allow "google.com" to link while still protecting from other sites. I don't have the code on me, but you'll find it on google

Yidaki

12:33 pm on Aug 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




RewriteCond %{HTTP_REFERER}!^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3])\..*(www\.)? yourdomain\. com [NC]
RewriteCond %{HTTP_REFERER}!^http://babel.altavista.com/.*(www\.)? yourdomain\. com [NC]

There are other referers (translators, proxies, etc.) you might want to allow as well.

claus

12:36 pm on Aug 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are probably right about the hotlink protection. You could include a rewrite condition like this:

RewriteCond %(HTTP_REFERER) "!^http:\/\/(www.)?google(\.co[m]?)?(\.[a-z]{2})?\/.*q=cache:"

- which would catch the cache using Google domain-names, but it would not catch the IPs like this one:

[216.239.37.104...]

It seems like this string is constant, so you could match it in stead:

/search?q=cache:

- so this (much simpler) rule should be enough to do the trick:

RewriteCond %(HTTP_REFERER) "!\/search\?q=cache:"

/claus

ALbino

3:11 am on Aug 25, 2003 (gmt 0)

10+ Year Member



This is a great idea. My site denies hotlinking to everyone but images.google.com. It never occured to me to also allow G's cache and sites such as Babelfish. Does anyone have a list of sites that they allow to hotlink because they might have legitimate uses? Other translation sites perhaps? A master list along these lines might be a good idea.

jdMorgan

5:41 am on Aug 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A fairly thorough recent list:

[webmasterworld.com...]

Note that the method used in the cited thread does not use mod_rewrite. Those who wish to use mod_rewrite will need to do a little reformatting, but the list is a good one.

Jim