You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vik Rubenfeld <vi...@mindspring.com> on 2005/01/25 05:35:47 UTC

[users@httpd] Htaccess code to Deny Referrers Spam?

I've got htaccess code to get rid of referrer spam. Here's an example:

SetEnvIfNoCase Referer ".*(stormfront).*" BadReferer
order deny,allow
deny from env=BadReferer

It works correctly in most cases. However, I have the following line:

    SetEnvIfNoCase Referer ".*(poker-).*" BadReferer

...and I find that that line is not catching referrers such as the
following:

    free-texas-hold-em-poker-games.fidelityfunding.net
    online-poker-rooms.fidelityfunding.net
    texas-holdem-poker-game.fidelityfunding.net

How do I correct that line to get it to catch those referrers? Thanks in
advance for any info.


-Vik



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Htaccess code to Deny Referrers Spam?

Posted by Vik Rubenfeld <vi...@mindspring.com>.
On 1/26/05 12:11 PM, "Joshua Slive" <js...@gmail.com> wrote:

> Test it yourself by manually
> constructing a request as in
> 
> telnet yourhost 80
> GET /page.html HTTP/1.0
> Host: yourhost.example.com
> Referer: http://poker-whatever.com/
> [enter]

Great stuff. Thanks, Joshua.

-Vik



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Htaccess code to Deny Referrers Spam?

Posted by Joshua Slive <js...@gmail.com>.
On Wed, 26 Jan 2005 11:19:04 -0800, Vik Rubenfeld <vi...@mindspring.com> wrote:
> > Did you check if it matches if you remove the dash?
> 
> The dash is there for a specific reason; it is so as to be cautious about
> which referrers are excluded. There might be some referrers with that string
> of text included in a larger string, which I would like not to exclude. Note
> that "poker-" is just one example; what I learn on this subject, I will use
> with lots of different text strings.

I understand that, but you need to narrow down where the problem is. 
I don't see myself anything wrong with your regex.

> > Have you tried it?  You'll get an answer much quicker if you test
> > stuff yourself rather than sending an email to the list.
> 
> I don't think that's quite accurate. I may have to wait many days, to get
> that specific referrer spam again.

You'll never fix the problem that way.  Test it yourself by manually
constructing a request as in

telnet yourhost 80
GET /page.html HTTP/1.0
Host: yourhost.example.com
Referer: http://poker-whatever.com/
[enter]

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Htaccess code to Deny Referrers Spam?

Posted by Vik Rubenfeld <vi...@mindspring.com>.
> Did you check if it matches if you remove the dash?

The dash is there for a specific reason; it is so as to be cautious about
which referrers are excluded. There might be some referrers with that string
of text included in a larger string, which I would like not to exclude. Note
that "poker-" is just one example; what I learn on this subject, I will use
with lots of different text strings.

>>> You've got a bunch of superfluous stuff there.  You could probably use just
>>> SetEnvIfNoCase Referer "poker-" BadReferer
>> 
>> Isn't it necessary to use some sort of wildcard match to catch characters to
>> the right and left of the string, "poker-"?
> 
> No.

Can you provide additional information? Compared to most people on this
list, I'm an Apache newbie. I have a weblog I'm seeking to maintain, and for
some reason information on doing what I'm trying to do with htaccess is not
easy to find. 

> Have you tried it?  You'll get an answer much quicker if you test
> stuff yourself rather than sending an email to the list.

I don't think that's quite accurate. I may have to wait many days, to get
that specific referrer spam again.



-Vik 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Htaccess code to Deny Referrers Spam?

Posted by Joshua Slive <js...@gmail.com>.
On Wed, 26 Jan 2005 01:22:12 -0800, Vik Rubenfeld <vi...@mindspring.com> wrote:
> Hi Joshua,
> 
> Thanks for the feedback.
> 
> > A little more debugging on your part would be helful.
> > Have you checked to see if the problem is the dash?
> 
> Yes, I did check the dashes. It's the same dash character.

Did you check if it matches if you remove the dash?

> 
> > You've got a bunch of superfluous stuff there.  You could probably use just
> > SetEnvIfNoCase Referer "poker-" BadReferer
> 
> Isn't it necessary to use some sort of wildcard match to catch characters to
> the right and left of the string, "poker-"?

No.

Have you tried it?  You'll get an answer much quicker if you test
stuff yourself rather than sending an email to the list.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Htaccess code to Deny Referrers Spam?

Posted by Vik Rubenfeld <vi...@mindspring.com>.
Hi Joshua,

Thanks for the feedback.

> A little more debugging on your part would be helful.
> Have you checked to see if the problem is the dash?

Yes, I did check the dashes. It's the same dash character.

> You've got a bunch of superfluous stuff there.  You could probably use just
> SetEnvIfNoCase Referer "poker-" BadReferer

Isn't it necessary to use some sort of wildcard match to catch characters to
the right and left of the string, "poker-"?

If that is necessary, is the following the correct syntax?

     SetEnvIfNoCase Referer ".*(poker-).*" BadReferer


-Vik




On 1/25/05 9:46 AM, "Joshua Slive" <js...@gmail.com> wrote:

> On Mon, 24 Jan 2005 20:35:47 -0800, Vik Rubenfeld <vi...@mindspring.com> wrote:
>> I've got htaccess code to get rid of referrer spam. Here's an example:
>> 
>> SetEnvIfNoCase Referer ".*(stormfront).*" BadReferer
>> order deny,allow
>> deny from env=BadReferer
>> 
>> It works correctly in most cases. However, I have the following line:
>> 
>>     SetEnvIfNoCase Referer ".*(poker-).*" BadReferer
>> 
>> ...and I find that that line is not catching referrers such as the
>> following:
>> 
>>     free-texas-hold-em-poker-games.fidelityfunding.net
>>     online-poker-rooms.fidelityfunding.net
>>     texas-holdem-poker-game.fidelityfunding.net
>> 
>> How do I correct that line to get it to catch those referrers? Thanks in
>> advance for any info.
> 
> A little more debugging on your part would be helful.
> Have you checked to see if the problem is the dash?
> 
> You've got a bunch of superfluous stuff there.  You could probably use just
> SetEnvIfNoCase Referer "poker-" BadReferer
> 
> Joshua.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Htaccess code to Deny Referrers Spam?

Posted by Joshua Slive <js...@gmail.com>.
On Mon, 24 Jan 2005 20:35:47 -0800, Vik Rubenfeld <vi...@mindspring.com> wrote:
> I've got htaccess code to get rid of referrer spam. Here's an example:
> 
> SetEnvIfNoCase Referer ".*(stormfront).*" BadReferer
> order deny,allow
> deny from env=BadReferer
> 
> It works correctly in most cases. However, I have the following line:
> 
>     SetEnvIfNoCase Referer ".*(poker-).*" BadReferer
> 
> ...and I find that that line is not catching referrers such as the
> following:
> 
>     free-texas-hold-em-poker-games.fidelityfunding.net
>     online-poker-rooms.fidelityfunding.net
>     texas-holdem-poker-game.fidelityfunding.net
> 
> How do I correct that line to get it to catch those referrers? Thanks in
> advance for any info.

A little more debugging on your part would be helful.
Have you checked to see if the problem is the dash?

You've got a bunch of superfluous stuff there.  You could probably use just
SetEnvIfNoCase Referer "poker-" BadReferer

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org