Re: [squid-users] Redirecting Based on the Referer

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Sun, 24 Jun 2007 22:20:59 +0200

sön 2007-06-24 klockan 19:06 +0200 skrev Andreas Pettersson:
> Max Clark wrote:
> > Henrik,
> >
> > Can you point me to a simple example that I could work from?
> From reading the manual I'd think something like this could work:
>
> acl abuser referer http://www.abuser.com/abusing_link.html
> http_access deny abuser
> deny_info http://www.mysite.com/youarenotallowed.html abuser
>
> However, the manual also states that referer is not to be trusted in all
> cases.
> http://www.squid-cache.org/Versions/v2/2.6/cfgman/acl.html

I would do it slightly differently, allowing acceptable referer
(possibly including no referer) and denying all else.. but the principle
is the same.

acl has_referer referer_regex .
acl good_referer referer_regex -i http://www.example.com http://www.example.net
acl limited_content urlpath_regex -i /limited_directory

http_access deny limited_content has_referer !good_referer

deny_info http://www.mysite.com/no-deep-linking.html good_referer

Regards
Henrik

Received on Sun Jun 24 2007 - 14:21:04 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Jul 01 2007 - 12:00:04 MDT