Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache block by referrer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Apreche
Guru
Guru


Joined: 18 Sep 2003
Posts: 506
Location: Beacon, NY

PostPosted: Sun May 01, 2005 1:40 am    Post subject: apache block by referrer Reply with quote

Ok, so my blog gets some blog spam now and then. I just realized that a great quantity of this blog spam comes from visits from certain urls like whvc.net. How can I configure apache to block anybody from whvc.net? How about blocking all visints from anyone with a URL that matches a particular regular expression like /poker/. If I could do this it would make my life a whole lot easier. Thanks.
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sun May 01, 2005 6:03 am    Post subject: Reply with quote

you could try this by adding it to your vhost..

Code:
<Directory />
order allow,deny
allow from all
deny from whvc.net
</Directory>


If you want to do it with regex.. you could try mod_rewrite. I think you can block them, or at least redirect them with mod_rewrite. I would try the deny statement above first.

HTH
hanji
Back to top
View user's profile Send private message
Apreche
Guru
Guru


Joined: 18 Sep 2003
Posts: 506
Location: Beacon, NY

PostPosted: Sun May 01, 2005 2:31 pm    Post subject: Reply with quote

awesome thanks, maybe I'll do a mod_rewrite later so that I can make a text file with a list of domains to block and then the regex will get inserted into the config.

If anyone else has done this already, or wants to do it for me though, I'm not going to stop you :)
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sun May 01, 2005 3:16 pm    Post subject: Reply with quote

Hello

Quote:
awesome thanks, maybe I'll do a mod_rewrite later so that I can make a text file with a list of domains to block and then the regex will get inserted into the config.


You can do it via PHP w/RegEx on your script, but you won't be able to do that with mod_rewrite, since you would need to restart the server for the changes to be loaded.

hanji
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum