Hotlinking is a way to take images or other files and embed them directly into a website that doesn't own those files. In other words, it is an unauthorized use of someone else's bandwidth. 
When hotlinking is detected and you need to serve some unexpected alternate content, add the following code to your .htaccess file. This will protect all files of the types included in the last line (add more types if needed):
# stop hotlinking and serve alternate content
<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteRule .*.(gif|jpg)$ [R,NC,L]
To deliver a standard (or custom, if configured) error page instead of some yucky, but funny image, replace the line containing the RewriteRule in the .htaccess directive with the following line:

# serve a standard 403 forbidden error page
RewriteRule .*.(gif|jpg)$ - [F,L]
To grant linking permission to a site other than yours, insert this code block after the line containing the string. Remember to replace with the actual site domain:
# allow linking from the following site