domain redirect squid
I want to redirect domain using squid:
like if I type www.yahoo.com it take me to www.google.com at client side pls input on above I have already tried squirum but that's no gain. |
Hi,
May be you can try it with url_rewrite_program =====squid.conf==== url_rewrite_program /usr/sbin/url_redirect.php url_rewrite_children 5 ====/usr/sbin/url_redirect.php======= #!/usr/bin/php <?php $temp = array(); while ( $input = fgets(STDIN) ) { // Split the output (space delimited) from squid into an array. $temp = split(' ', $input); // Set the URL from squid to a temporary holder. $output = $temp[0] . "\n"; // Clean the Requesting IP Address field up. $ip = split('/',rtrim($temp[1], "/-")); if (preg_match("/^http:\/\/www.yahoo.com/i", $temp[0])) { $output = "301:http://www.google.com\n"; } echo $output; } |
All times are GMT -5. The time now is 08:49 AM. |