Re: [squid-users] URL redirection

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 5 May 2009 12:05:20 +1200 (NZST)

>
> Hi,
> I would like to ask you is there a way to configure squid to redirect
> IPs.
> I want squid to read IP's from file saved in .TXT format saved on HDD or
> server on internet. And when user's IP matches with the IP from the TXT
> file
> squid redirects it to external URL hosted on remote server.

Umm, what exactly are you trying to do with this?
There are several scenarios each with different solutions possible.

Please note the IPs do not have a 1:1 relationship with URLs so rewriting
a URL based on it's IP is not generally possible.
For example, the URL http://www.google.com/ for example has several
hundred geo-located IPs (not all of which are visible at any time or at
all), and each of those IPs has a few dozen domain names.

> Second question - is there a way to configure squid to read the external
> TXT
> file every 10 minutes for example so when I manually enter new IP or
> remove
> old one squid reads it and reconfigure itself.

No.
For this type of thing use an external_acl_type helper. They are tested
live for every request with an optional caching time in seconds for the
results.

I'm getting a vague Idea about what you are trying to do, I don't think
you want redirection at all. But please state what it is clearly so we can
be of more help.

Amos
Received on Tue May 05 2009 - 00:05:33 MDT

This archive was generated by hypermail 2.2.0 : Wed May 06 2009 - 12:00:02 MDT