lucy24 - 3:05 am on Jan 25, 2013 (gmt 0)
Infinite loop, the image wouldn't load on the page unless you limit by domain.
As with the ordinary hotlinking routine-- and remember, your server can't tell the difference between a hotlink and a direct image link-- you make an exemption for yourself as referer. That means an image called by your own page comes through as intended.
This thread moved me to do a bit of experimenting. I only tried it on my own setup (live site, not MAMP), so ymmv. If there is a deep-link to an image in the form <a href ... .jpg> you can redirect to a page. But the redirect will not take place if it's a hotlink in the form <img src ... .jpg> That's with an explicit [R=301] redirect; I didn't check whether a silent rewrite behaves the same. But in this situation a redirect is probably what you'd want anyway.
And then, of course, you have to know what to redirect to. It isn't a one-size-fits-all "No Hotlinks!" or "Stop Thief!" graphic. So now we're in detour-to-php-script territory.