How do you redirect google images traffic to another url?

Discussion in 'Apache' started by mightyb, Apr 16, 2006.

  1. #1
    mightyb, Apr 16, 2006 IP
    ryan_uk likes this.
  2. Kat2

    Kat2 Well-Known Member

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Here's a generator that will do it for you.

    http://www.htmlbasix.com/disablehotlinking.shtml

    You'll type in domains you *want* to allow to hotlink - basically your own. All others will be blocked. Hit Block Blank Referers if you want to. You can choose to type in where to direct the user instead, or an image to replace it (e.g. one that says "don't steal bandwidth.")

    I did a quick one for you, that allows only your domain to hotlink, blocks blank referers, and redirects them to your main page:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?daily3gp.com(/)?.*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.daily3gp.com/ [R,NC]
     
    Kat2, Apr 16, 2006 IP
    mightyb likes this.
  3. ryan_uk

    ryan_uk Illustrious Member

    Messages:
    3,983
    Likes Received:
    1,022
    Best Answers:
    33
    Trophy Points:
    465
    #3
    Maybe:

    SetEnvIfNoCase Referer ".*images.google.*" GoogleImages
    order deny,allow
    deny from env=GoogleImages

    It's not a redirect but a bandwidth saver.

    Off topic: by the way, you probably need more space between images and the google ads.
     
    ryan_uk, Apr 16, 2006 IP
    mightyb likes this.
  4. mightyb

    mightyb Banned

    Messages:
    6,566
    Likes Received:
    405
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Kat2

    Great, thanks!

    ryan_uk

    Yea, im testing a new positioning etc Ta!
     
    mightyb, Apr 16, 2006 IP
  5. ryan_uk

    ryan_uk Illustrious Member

    Messages:
    3,983
    Likes Received:
    1,022
    Best Answers:
    33
    Trophy Points:
    465
    #5
    Good luck!

    by the way, it's possible to also direct all image requests through a php script, too. This can be helpful if you want to hide the images true location. I wrote an article with the script included.
     
    ryan_uk, Apr 16, 2006 IP
  6. mightyb

    mightyb Banned

    Messages:
    6,566
    Likes Received:
    405
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I have actually managed to find a script that will do it but have not tested it.
     
    mightyb, Apr 16, 2006 IP