anyone here know how I may block all incoming http request where the referring url has the characters "sex" in it? It appears google picked up on three articles with the word sex and a combination of a specific ethnicity in it and I am getting way too many perverts signing up for free account on my site..assuming they'll get wonderstash upon signup.. (it's a literary content site) ..this is affecting my demographics.last month 70% of hits were sex related ..
I was told I can do this with Rewrite rules on http referrer.. but am not sure how to go about it..
If you're using an Apache server, mod_rewrite will do what you want. We have several experts that are VERY generous in helping members sort out problems. But WebmasterWorld prefers to HELP, not "do it for you."
So where to begin? At the top of your screen is a link to "site search" that will help you find numerous mod_rewrite discussions on this board.
The Apache module mod_rewrite is a killer one, i.e. it is a really sophisticated module which provides a powerful way to do URL manipulations. With it you can nearly do all types of URL manipulations you ever dreamed about. The price you have to pay is to accept complexity, because mod_rewrite's major drawback is that it is not easy to understand and use for the beginner.
Since you wanted to catch either of those words occurring anywhere in the referral string, you don't need start "^" or end "$" anchors on your patterns. Plus, you can OR them together under one RewriteCond to speed things up. The R=301 makes this a permanent redirect, and the L means don't bother to process any more RewriteRules, because you're booting them out to di$ney right now.
Note: You may have to edit that "¦" character. Use the one on your keyboard to replace it.