Amos Jeffries-2 wrote: > > rcbandit wrote: >> >> >> Amos Jeffries-2 wrote: >>>> 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 >>> >>> >>> >> >> >> I want to write a PHP billing system for ISPs and web hosting. It's a >> hobby >> project. >> My idea is to control the access to the internal servers with squid and >> PHP >> program. When the owner of the server don't pay squid blocks the access. >> I will write a PHP program witch will pass IPs to the squid using .TXT >> file. >> Squid reads the IPs from the file and blocks the access. So I need a way >> to >> force squid to read that .TXT file. > > Definitely external_acl_type then. > > FWIW all the CDN providers I know of (self included) have some form of > this already existing in practice. Often more efficiently integrated > into the local authentication mechanisms than .txt method would allow for. > > The formal Quota feature is also being worked on to integrate finer > control into later Squid releases. > > Amos > -- > Please be using > Current Stable Squid 2.7.STABLE6 or 3.0.STABLE14 > Current Beta Squid 3.1.0.7 > > How to integrate squid's local authentication mechanisms with PHP program. Do you know how to do it? -- View this message in context: http://www.nabble.com/URL-redirection-tp23378517p23402196.html Sent from the Squid - Users mailing list archive at Nabble.com.