Forum Moderators: coopster

Message Too Old, No Replies

How to show the redirecting domain as the referer in the logs?

How to redirect the so you are see as the referer.

         

ArcticCelt

10:17 pm on Nov 21, 2002 (gmt 0)

10+ Year Member



Is it possible to make a redirection so the logs of the person that receive the traffic shows me as the referrer and not the site that linked to my redirection?

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!

Brett_Tabke

10:21 pm on Nov 21, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The only way to do it is with a meta refresh. A "location" redirect (301), always shows the original referrer in most major browsers.

ArcticCelt

10:56 pm on Nov 21, 2002 (gmt 0)

10+ Year Member



Thanks for your help I appreciate. Unfortunately this is something I have already tried. The result is that it doesn't show any more the referer at all.

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)

Brett_Tabke

11:33 pm on Nov 21, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



hmm. I'll restudy the Meta issue again. I was sure it would pass the referrer from the meta refreshed page. Maybe there is some qualifier involved?

andreasfriedrich

2:06 am on Nov 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tested both Redirect and Refresh and neither does what you want.

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

cminblues

8:54 am on Nov 24, 2002 (gmt 0)

10+ Year Member



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