Forum Moderators: phranque
Redirect 302 /link http://www.example.com
... and in robots.txt I have this ...
User-agent: *
Disallow: /link
The idea is to make all links like this...
mysite.com/link/example.php?param1=a¶m2=b¶m3=c
... redirect to ...
example.com/example.php?param1=a¶m2=b¶m3=c
This seems to work perfectly, but I just wanted to check that I am not missing anything, because the parameters and the file example.php may change.
Also, can anybody confirm that this redirect plus the robots.txt file will totally mask these affiliate links from SE's?
Thanks.
[edited by: WebWalla at 10:36 am (utc) on Nov. 20, 2007]
I'd recommend removing the /links Disallows in robots.txt, and using a 301 redirect.
Jim
I don't want the spiders to see my redirects because I don't want the SE's to see these affiliate links on mysite.com. I want them to think I am linking to content on my own site, even though the destination pages won't be indexed.
I also want the SE's to maintain the old URL's (mysite.com/link/example.php?param1=a¶m2=b¶m3=c) and not the new ones on example.com
Thanks.
#!/usr/bin/perl
if ($ENV{'REQUEST_METHOD'} eq "GET") {
$in = $ENV{'QUERY_STRING'};
} else {
$in = <STDIN>;
}
$in =~ s/%(..)/pack("c",hex($1))/ge;
$params=$in;
$url='http://www.example.com/' . $params;
print "Location: $url\n\n";
It will be called in this way ...
mysite.com/cgi-bin/redirect.cgi?dir1/example.php?param1=a¶m2=b¶m3=C