.htaccess help..

Discussion in 'Apache' started by terryuk, Jan 20, 2007.

  1. #1
    I'm trying to get a cool hotlinking system up, so basically if they hotlink an image, it displays the image and a backlink to my website. But i'm getting confused...

    The pictures are all in siteurl.com/pictures/ - so i need to do it so if they load a picture, they are redirected to a php file..

    Right now i have;

    RewriteRule ^pictures/(.*) http://www.url.com/showpic.php?pic=$1

    But it doesn't work.. anyone got any suggestions please
     
    terryuk, Jan 20, 2007 IP
  2. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try..
    RewriteRule ^pictures/(.*) showpic.php?pic=$1
    Code (markup):
     
    rodney88, Jan 20, 2007 IP
  3. gbh1935

    gbh1935 Peon

    Messages:
    585
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    but you need to add a condition so that you are only effecting remote sites that are linking to your site.

    RewriteEngine
    OnRewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
    RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
    RewriteRule ^pictures/(.*) http://www.yoursite.com/showpic.php?pic=$1
     
    gbh1935, Jan 20, 2007 IP