Forum Moderators: phranque
However, I have some keyword blocks for dodgy referrers, such as the word "casino", etc.
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-¦.)casino(-¦.).*$ [NC,OR]
For some reason this doesnt seem to work... eg, I still get lots of referrers with addresses like casinofun.com, casino-madness.com, etc.
Is there a better way to block a keyword? Maybe removing the www bit? What would be the correct way to do this?
Kim
RewriteCond %{HTTP_REFERER} casino [NC,OR]
How you do this depends on what you want to do, and every Web site is different. Your original pattern had some questionable constructions in it, so I'd suggest a review of the regular expressions tutorial cited in our forum charter [webmasterworld.com]. Only by understanding the regex patterns can you understand the function of the code. And only then can you tailor your code to do what you want, not what *I* think you want, or what anyone else here might think you want... We could easily be wrong, and it's your site that will suffer the result.
Jim