Using .htaccess for Hotlink Protection. How to allow Google?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sixxxthsense
    Confirmed User
    • Aug 2004
    • 2419

    #1

    Using .htaccess for Hotlink Protection. How to allow Google?

    I've enable hotlink protection on all my sites, now how do I allow google to hotlink images from my site. For example when doing an image search, I want them to cache my images.

    Will this code work???
    Code:
    RewriteCond %{HTTP_REFERER} !^http://.*google.([^/]+)/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://.*google.([^/]+)$ 	[NC]
  • sixxxthsense
    Confirmed User
    • Aug 2004
    • 2419

    #2
    come on, someone has to know, dont tell me today is ALL SURFERS day!

    Comment

    • joechip
      Registered User
      • Apr 2003
      • 27

      #3
      Originally posted by sixxxthsense
      I've enable hotlink protection on all my sites, now how do I allow google to hotlink images from my site. For example when doing an image search, I want them to cache my images.

      Will this code work???
      Code:
      RewriteCond %{HTTP_REFERER} !^http://.*google.([^/]+)/.*$ [NC]
      RewriteCond %{HTTP_REFERER} !^http://.*google.([^/]+)$ 	[NC]
      Google Images doesn't hotlink your thumbnails, so you can still get a thumbnail linked to your gallery or whatever on the image search without letting them hotlink to your pics.

      Comment

      • sixxxthsense
        Confirmed User
        • Aug 2004
        • 2419

        #4
        Originally posted by joechip
        Google Images doesn't hotlink your thumbnails, so you can still get a thumbnail linked to your gallery or whatever on the image search without letting them hotlink to your pics.
        so the pic won't be brokeN???? how will they grab a cach of it then?

        Comment

        • sickkittens
          I am a meat popsicle.
          • Jul 2002
          • 25100

          #5
          How do I change my image in Google to forward surfers a given site (in the frame) when they click on the thumb?

          HIGHEST PAYOUTS FOR NO-CONSOLE TOURS IN THE ENTIRE INDUSTRY!

          THIS SIG CAN BE YOURS FOR $200 - ICQ: 78881543

          Comment

          • Lycanthrope
            Confirmed User
            • Jan 2004
            • 4517

            #6
            joechip is partly correct...

            However, make sure you allow null referrers if you want the spiders to find your images, otherwise they'll redirect per your hotlink instructions.

            This says, allow null referrers and requests from my domain only to display images. Send all other requests to hotlink.html:

            RewriteEngine On
            RewriteCond %{HTTP_REFERER} !^$
            RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com.*$ [NC]
            RewriteRule .*[Jj][Pp][Gg]$|.*[Jj][Pp][Ee][Gg]$|.*[Gg][Ii][Ff]$ http://www.yourdomain.com/hotlink.html

            Comment

            • Lycanthrope
              Confirmed User
              • Jan 2004
              • 4517

              #7
              Originally posted by sickkittens
              How do I change my image in Google to forward surfers a given site (in the frame) when they click on the thumb?
              Use a framebuster script and you won't have to worry about the site getting framed.

              Comment

              • Manowar
                jellyfish  
                • Dec 2003
                • 71528

                #8
                http://www.businessvoyeur.com/2005-0...nking-in-depth

                Comment

                • sixxxthsense
                  Confirmed User
                  • Aug 2004
                  • 2419

                  #9
                  Originally posted by Lycanthrope
                  joechip is partly correct...

                  However, make sure you allow null referrers if you want the spiders to find your images, otherwise they'll redirect per your hotlink instructions.

                  This says, allow null referrers and requests from my domain only to display images. Send all other requests to hotlink.html:

                  RewriteEngine On
                  RewriteCond %{HTTP_REFERER} !^$
                  RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com.*$ [NC]
                  RewriteRule .*[Jj][Pp][Gg]$|.*[Jj][Pp][Ee][Gg]$|.*[Gg][Ii][Ff]$ http://www.yourdomain.com/hotlink.html
                  I've got that part, I just wanna know how to allow google's domain cuz google has .com, .ca, .uk and all these others ... I belive that there is a single RewriteCond line that does it

                  Comment

                  • sixxxthsense
                    Confirmed User
                    • Aug 2004
                    • 2419

                    #10
                    bump for night shift

                    Comment

                    Working...