[help].htaccess image hotlinking for php url's

Discussion in 'Apache' started by cosy, Aug 28, 2008.

  1. #1
    the typical solution is
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?site.com [NC]
    RewriteRule \.(gif)$ site.com/nohotlink.gif [L]
    Code (markup):
    but the problem is my image url are like
    img.php?n=123
    Code (markup):
    if i put RewriteRule \.(php) is blocking all the php not the images
    any ideas ?
     
    cosy, Aug 28, 2008 IP
  2. The Universes

    The Universes Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use PHP to block referrers that arent your sites URL.
    returns the referring URL
     
    The Universes, Aug 28, 2008 IP