homepage Welcome to WebmasterWorld Guest from 54.242.126.9
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

This 31 message thread spans 2 pages: < < 31 ( 1 [2]     
fixing a regex in htaccess
This regex doesn't seem to work
ianevans

10+ Year Member



 
Msg#: 323 posted 8:22 am on Aug 5, 2003 (gmt 0)

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

 

ianevans

10+ Year Member



 
Msg#: 323 posted 12:39 am on Aug 14, 2003 (gmt 0)

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 ( 1 [2]
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved