[squid-users] Replacing an image based on the refer...

From: John Doe <jdmls_at_yahoo.com>
Date: Tue, 12 Aug 2008 09:03:33 -0700 (PDT)

Hi,

I need to use an external program to potentially replace images requests, based on the referers, but url_rewrite does not pass the referer.
It is for people direct linking images on many external sites/forums.
I need the referer because the images seen directly on our site should not be replaced.
Would a combination with external_acl do the trick?

  external_acl_type abuser children=5 %SRC %{Referer} "/squid/abuse.php"
  url_rewrite_access allow abuser
  url_rewrite_access deny all

The thing is, I need also to rewrite legit URLs in some other cases...
Can I have more than one url_rewrite blocks?

  url_rewrite_program "/squid/abuse_rewrite.php"
  url_rewrite_children 5
  url_rewrite_concurrency 0
  url_rewrite_host_header off
  url_rewrite_access allow abuser
  url_rewrite_access deny all

  url_rewrite_program "/squid/oldurl2newurl.php"
  url_rewrite_children 5
  url_rewrite_concurrency 0
  url_rewrite_host_header off
  url_rewrite_access allow all

Thx,
JD

      
Received on Tue Aug 12 2008 - 16:03:42 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 14 2008 - 12:00:03 MDT