[squid-users] ERROR: URL-rewrite

Eliezer Croitoru eliezer at ngtech.co.il
Tue Sep 30 11:13:25 UTC 2014


-----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-----


More information about the squid-users mailing list