So I am able to block specific subdomains like this:
SetEnvIfNoCase Referer knownsub\.sorryspammer\.com sorryspammer <Location /> Order Allow,Deny Allow from all Deny from env=sorryspammer </Location>
which does successfully block visits to any site on my server that come from the referrer, knownsub.sorryspammer.com
So now, I am getting visits from referrers like 1.sorryspammer.com, 2.sorryspammer.com, 8.sorryspammer.com, 22.sorryspammer.com, etc., and I need to set an environment variable to block any subdomain coming from the referrer domain sorryspammer.com.
I know I need to set the same basic rule for the environment variable but with a wildcard for the subdomain part. I've tried a couple of things, most recently this:
SetEnvIfNoCase Referer (.*)\.sorryspammer\.com sorryspammer
but I am still getting visits from referrers from subdomains on sorryspammer.com. I know I'm missing something real simple. Not sure if it matters, but keep in mind that this is not going in an .htaccess file but is going in the httpd.conf file to apply the rules server wide.