Apache - Blocking referrers

Igor Pruchanskiy igor at linuxinside.com
Wed Sep 12 11:40:24 PDT 2001


On Wed 12 Sep 2001, Igor Pruchanskiy wrote:
> On Wed 12 Sep 2001, Jason Buscema wrote:
> > I want to know if it is possible to block access to my web site if 
> > the user is referred from a specific web site. I've only denied 
> > access from IPs before, not by referring web sites. Is this possible.
> 
> I would use mod_rewrite, unless you did not compile it into apache. If you
> installed from a package it will most likely be supported.
> 
> RewriteEngine On
> RewriteCond %{HTTP_REFERER} ^.+\.badguys.com/.*$ [NC]
> RewriteRule ^/(.*) http://www.google.com/ [R,L]
> 
> I also just came across a killer mod_rewrite manual
> http://japache.infoscience.co.jp/rewriteguide/original/

doh! forgot to mention.
you must have LogFormat set on combined for this to work

-- 
Uptime:  10 days, 11:45



More information about the KPLUG-List mailing list