Hotlinking images

  • Posted: 05 November 2005 08:54 AM

    I was having a problem with external sites hotlinking images and stealing
    bandwidth.

    The best solution I found was to add the following code to the .htaccess file in the root directory.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} .
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourwebsite\.com [NC]
    RewriteRule \.(gif|jpe?g)$ - [NC,F]

    I got the information here:

    http://www.webmasterworld.com/forum23/3763.htm

    It offers variations on this solution for other situations.

    Signature

    It’s safe as long as you remember it’s dangerous…