it's easy with htaccess
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://cgi.(aol\.)?ebay\.com [NC]
RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://YOUR_SITE_IP [NC]
RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://YOUR_SITE_DOMAIN [NC]
RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://OTHER_SITE_DOMAIN [NC]
RewriteRule \.(bmp|gif|jpe?g)$ - [F,L]
where
YOUR_SITE_IP = your server ip 123.123.123.123
YOUR_SITE_DOMAIN =
www.my_cool_domain.com
OTHER_SITE_DOMAIN - other domain that you allow hotlink