<div dir="ltr"><div><div><div><div>Thanks for your answers.<br></div><br>I think the url was (<a href="http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors">http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors</a>) but now the site is down for maintenance, so I can't validate that.<br><br></div>You're right about the version, my mistake.<br><br></div>I'm going to use another language and change the redirector output according to the version.<br><br></div>Thanks again<br>Alejandro<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-30 8:13 GMT-03:00 Eliezer Croitoru <span dir="ltr"><<a href="mailto:eliezer@ngtech.co.il" target="_blank">eliezer@ngtech.co.il</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</span>Hey Alejandro,<br>
<br>
Can I ask where in the site have you taken this code from?<br>
Using php as a helper is not such a good choice due to couple issues<br>
it has with squid "stdin\stdout" emulation.<br>
<br>
You'd better use perl\python\ruby\other then php unless you found a<br>
solution to a bug that php developers consider a feature.<br>
<br>
Also only squid 3.4 uses the "OK rewrite-url=XYZ" format and "ERR"<br>
in squid 3.3 you use either a "<a href="http://xyz" target="_blank">http://xyz</a>" as it is or<br>
"302:<a href="http://xyz" target="_blank">http://xyz</a>" for a redirection and a blank line "" for no change.<br>
<br>
All The Bests,<br>
Eliezer<br>
<span class=""><br>
On 09/29/2014 12:39 PM, Alejandro Martinez wrote:<br>
> the redirector code is this (code taken from squid site):<br>
><br>
> $temp = array(); stream_set_timeout(STDIN, 86400);<br>
><br>
> while ( $input = fgets(STDIN) ) { $temp = split(' ', $input); $url<br>
> = $temp[0]; if ( $url == "<a href="http://www.google.com" target="_blank">http://www.google.com</a>" ) { echo "OK<br>
> rewrite-url=<a href="http://192.168.1.10/block.php" target="_blank">http://192.168.1.10/block.php</a> \n"; } else { echo "ERR<br>
> \n"; } }<br>
><br>
> Thanks<br>
<br>
</span>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1<br>
<br>
iQEcBAEBAgAGBQJUKpBVAAoJENxnfXtQ8ZQUqu8H/ifHq2l8BrrSb5JIo7xf4ijw<br>
1jRbFt37ApmrEFMmaiZVErEvAyi8miHqjmlgeLLA+efXydCIISbBZHOsDdOima+3<br>
gshG9gaceJ54zP0dGiPL1pCRioGY16R2JQh7nhWz/scSEVcmB1UQ4bHmrkpsJ9Y2<br>
OHwf/cuSGbYXtgzHsavDmNYdUp+UpJ0KtoealP35UmqizRW5OSA4YqusEPwxG1oj<br>
HRqHocPE9Lb0BMIkBjZDbWs9DMRYAvx6p5JJaCB0VpwpXBa8oIMB5Fke6AjoAwBn<br>
5k9nWo2myvQ+raa1WHldJF7xaUbFNVB2VFDt3Rw48PEVP+YJKIjlAZWpXzuZcnI=<br>
=XWQb<br>
<div class="HOEnZb"><div class="h5">-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a><br>
</div></div></blockquote></div><br></div>