Welcome to WebmasterWorld Guest from 22.214.171.124
This regex worked like a charm:
SetEnvIfNoCase Referer "^http://([^/]*)domain\.tld/" spam_ref=1
The example I saw had some more generic ways to look for URLS that contained certain terms so that you could block by forum software for example. (I've seen people using 50K images for avatars).
So I added an example regex:
SetEnvIfNoCase Referer "^http://([^/]*)phpbb([^/]*)/" spam_ref=1
Restarted Apache. I then headed off to a phpbb site I knew was stealing my photos and looked. Hmmm....cleared my cache. Went back....photos still there.
Is there an error in the regex? What do I need for "find this string in any URL"?
On a connected note: CSS has the selectoracle which explains CSS selectors: "Applies to an h1 in a div named #content". Is there a site where you can enter a regex expression and it fires back with "Looks for a string that doesn't start with 0-9 and contains the word 'whatever'"?