Redirect image to website

Discussion in 'Programming' started by meannn, Apr 8, 2010.

  1. #1
    Hello,

    In this url,

    click the see full size link (it will try to open full image), and it redirect you to the website.

    How to do that ?
     
    meannn, Apr 8, 2010 IP
  2. nimonogi

    nimonogi Active Member

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #2
    Copy this to the .htaccess file in your root directory:
    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
    
    Code (markup):
    Change yourdomain.com with your domain name.
     
    nimonogi, Apr 10, 2010 IP
  3. meannn

    meannn Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, but in that example, it will redirect you to the page that the image included.
     
    meannn, Apr 22, 2010 IP
  4. Vontage

    Vontage Peon

    Messages:
    141
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    but that will only redirect the dude if he requests the image directly, not if he loads a page that loads the image.
     
    Vontage, Apr 23, 2010 IP