If "example" is the domain name will this block referer spam from example dot anything plus subdomains?
SetEnvIf Referer example. bad_referer=1
deny from env=bad_referer
6:31 pm on May 11, 2012 (gmt 0)
you don't have to use the complete domain name and/or extension.
1) your env setting is ok. 2) change this to (IF REFEr contains example): SetEnvIf Referer example bad_referer
Note; you may use other words that come from the refers line as well, the use is not limited to domain name, just as long as you USE "contains", rather than the "begins with" or "ends with" anchors.
This belongs in the SSID forum [webmasterworld.com]
6:17 pm on May 12, 2012 (gmt 0)
Okay, thanks wilderness. I don't need the dot there I guess?
10:40 pm on May 12, 2012 (gmt 0)
In this specific context the dot won't do any harm, but it isn't needed... UNLESS there exist sites called, say, exampleofgoodstuff.com and you don't want to block those. Then it can make a big difference.
SetEnvIf and the shortcut BrowserMatch both use Regular Expressions. That means an unescaped dot . means "any character at all". If you need it to mean "only a dot and nothing else" then you have to escape it with a backslash like this \.