Project Description:
I need a script similar to this one but that can It can identify url paramaters and convert them to new parameters
In this example when typed google.com goes to yahoo.com
I need a script that when someone type
http://www.mydomain.com?prod=123&category=1
to redirect it to
http://www.mydomain.com?prod=789 category=5
I am using this script in my squid box
!/usr/bin/perl
$|=1;
while () {
@X = split;
$url = $X[0];
if ($url =~ /^http:\/\/google\.com/) {
print "302:https:\/\/yahoo\.com\n";
}
elsif ($url =~ /^http:\/\/www\.google\.com/) {
print "302:https:\/\/yahoo\.com\n";
}
elsif ($url =~ /^http:\/\/gmail\.com/) {
print "302:https:\/\/yahoo\.com\n";
}
else {
print "$url\n";
}
}