Forum Moderators: coopster
I have people from
www.sites_that_send_me_traffic.com (that I don't control) that are sending me trafic to www.mysite.com. On www.mysite.com I redirect the traffic to another site that is not mine www.the_site_that_receive_the_trafic.com. The problem is that on the logs of the site that receive the traffic, the referer is www.sites_that_send_me_traffic.com and not www.mysite.com. I want that my domain shows on the referer field of their logs. I am now using a PHP header redirection on my site:
<?php
header('Location:http://www.the_site_that_receive_the_trafic.com');
php?>
I am open to any other solution. I can use perl or php on the server side.
How to show the redirecting domain as the referer in the logs?
I you think its easier to achieve my goal with another language just tell me!
Another way that doesn't show a referrer at all is using a JavaScript redirect like this:
onLoad="top.location.href='http://www.site_that_receives_the_traffic.com'
I have also tried with the .htaccess file putting:
Redirect 303 / [site_that_receives_the_traffic.com....] This time the result is the same that with php header redirection.
Then I tried with perl two different ways:
#!/usr/bin/perl
$url="http://www.site_that_receives_the_traffic.com";
use CGI qw(:standard);
print redirect($url);
and
#!/usr/bin/perl
print "Location: [site_that_receives_the_traffic.com\n\n";...]
both gave me the same result as the PHP header redirecto or the .htaccess redirect. The referer is the first site (the site where the visitor click) and not the site that makes the redirect.
To only way that I found was to create a frame on www.mysite.com with inside the frame
[site_that_receives_the_traffic.com....] Then it shows my site in the logs of [site_that_receives_the_traffic.com....] But my url stays in the user browser. Solution I made a reload without the frame see my code:
<html>
<frameset rows="*" frameborder="no" border="0" framespacing="0" onLoad="top.location.href='http://www.thehomemarketplace.com'">
<frame src="http://www.qksrv.net/click-1151935-8234096" name="mainFrame" id="mainFrame" />
</frameset>
</html>
The problem with this is that I do two hits for each visitor and I will screw up the logs of my business partners on [site_that_receives_the_traffic.com....] I
Any other idea?
(I did the testing with ie 6.0)
The programming language you use does not really matter since they are only used to produce the appropriate HTTP header. It is then up to the browser to add the referrer when requesting a document.
It is rather strange that they donīt do that with the Refresh approach. It seems there is no way to force the UAs to add the referrer.
Andreas
RewriteRule ^(.+)$ http://www.the_site_that_receive_the_trafic.com/?FriendReferer=www.mysite.com/$1 [R] This way, 'www.the_site_that_receive_the_trafic.com' don't have the referers in logs, but at least [if enabled] he can see them in the query data.
[in Apache config, LogFormat "... %q..."]
Of course, you can use some RewriteCond before the rule.
cminblues