John Doe wrote:
Hi,
I am trying to do the following:
only if referer=external then run the external_acl helper
then, run the url_rewrite helper in any case
This seems to work:
external_acl_type filter %PATH /path/to/filter
acl filter external filter
acl our_referer referer_regex oursite.com
http_access allow !our_referer filter
url_rewrite_program /path/to/rewrite
...
url_rewrite_access allow all
Is it ok or is there a better way?
Thats pretty much it. Though you don't have any control over whether
http_access gets checked before or after url_rewrite. Fortunately ACLs
for http_access usually work on the raw input data.
Also, is there a way to pass 2 variables to the external_acl helper; like "%PATH %{Hdr:Referer}"?
Yes:
external_acl_type filter %PATH %{Referer} /path/to/filter
Amos
--
Please use Squid 2.7.STABLE4 or 3.0.STABLE8