Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

fixing a regex in htaccess

This regex doesn't seem to work



8:22 am on Aug 5, 2003 (gmt 0)

10+ Year Member

I set up a few setenvif's in my htaccess to zap the more notorious photo stealing forums and community site.

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'"?


12:39 am on Aug 14, 2003 (gmt 0)

10+ Year Member

Just wanted to thank all of you for your help. I've posted my findings/solution in the new thread:
[webmasterworld.com ]
This 31 message thread spans 2 pages: 31

Featured Threads

Hot Threads This Week

Hot Threads This Month