[squid-users] ERROR: URL-rewrite

Alejandro Martinez ajm.martinez at gmail.com
Wed Oct 1 02:02:09 UTC 2014


Thanks for your answers.

I think the url was (
http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors) but now the site
is down for maintenance, so I can't validate that.

You're right about the version, my mistake.

I'm going to use another language and change the redirector output
according to the version.

Thanks again
Alejandro


2014-09-30 8:13 GMT-03:00 Eliezer Croitoru <eliezer at ngtech.co.il>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hey Alejandro,
>
> Can I ask where in the site have you taken this code from?
> Using php as a helper is not such a good choice due to couple issues
> it has with squid "stdin\stdout" emulation.
>
> You'd better use perl\python\ruby\other then php unless you found a
> solution to a bug that php developers consider a feature.
>
> Also only squid 3.4 uses the "OK rewrite-url=XYZ" format and "ERR"
> in squid 3.3 you use either a "http://xyz" as it is or
> "302:http://xyz" for a redirection and a blank line "" for no change.
>
> All The Bests,
> Eliezer
>
> On 09/29/2014 12:39 PM, Alejandro Martinez wrote:
> > the redirector code is this (code taken from squid site):
> >
> > $temp = array(); stream_set_timeout(STDIN, 86400);
> >
> > while ( $input = fgets(STDIN) ) { $temp = split(' ', $input); $url
> > = $temp[0]; if ( $url == "http://www.google.com" ) { echo "OK
> > rewrite-url=http://192.168.1.10/block.php \n"; } else { echo "ERR
> > \n"; } }
> >
> > Thanks
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQEcBAEBAgAGBQJUKpBVAAoJENxnfXtQ8ZQUqu8H/ifHq2l8BrrSb5JIo7xf4ijw
> 1jRbFt37ApmrEFMmaiZVErEvAyi8miHqjmlgeLLA+efXydCIISbBZHOsDdOima+3
> gshG9gaceJ54zP0dGiPL1pCRioGY16R2JQh7nhWz/scSEVcmB1UQ4bHmrkpsJ9Y2
> OHwf/cuSGbYXtgzHsavDmNYdUp+UpJ0KtoealP35UmqizRW5OSA4YqusEPwxG1oj
> HRqHocPE9Lb0BMIkBjZDbWs9DMRYAvx6p5JJaCB0VpwpXBa8oIMB5Fke6AjoAwBn
> 5k9nWo2myvQ+raa1WHldJF7xaUbFNVB2VFDt3Rw48PEVP+YJKIjlAZWpXzuZcnI=
> =XWQb
> -----END PGP SIGNATURE-----
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20140930/dcac4bb6/attachment.html>


More information about the squid-users mailing list