View previous topic :: View next topic |
Author |
Message |
Apreche Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/19378161633fb2344c9b4da.jpg)
Joined: 18 Sep 2003 Posts: 506 Location: Beacon, NY
|
Posted: Sun May 01, 2005 1:40 am Post subject: apache block by referrer |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
hanj Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/104414163441b8c6c1a6b4e.gif)
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Sun May 01, 2005 6:03 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Apreche Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/19378161633fb2344c9b4da.jpg)
Joined: 18 Sep 2003 Posts: 506 Location: Beacon, NY
|
Posted: Sun May 01, 2005 2:31 pm Post subject: |
|
|
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 ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hanj Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/104414163441b8c6c1a6b4e.gif)
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Sun May 01, 2005 3:16 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|