Welcome to WebmasterWorld Guest from 34.229.24.100

Forum Moderators: Ocean10000 & 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)

Full Member

10+ Year Member

joined:Aug 5, 2003
posts:250
votes: 6


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)

Full Member

10+ Year Member

joined:Aug 5, 2003
posts:250
votes: 6


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