GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How do you send traffic through a redirect URL and change the referrer? (https://gfy.com/showthread.php?t=1014001)

Jakez 03-13-2011 07:32 PM

How do you send traffic through a redirect URL and change the referrer?
 
Basically I am trying to find a way to send traffic through a URL and have the referrer shown at that URL. So let's say I have links on:

site1.com
site2.com
site3.com

And the links point to othersite.com/link1, which redirects to finalsite.com. I need finalsite.com's referrer stats to say that all the traffic came from othersite.com/link1 and not a bunch of traffic sources.

Usually when you send traffic through a redirect like that the referrers will show up as the original sources.

georgeyw 03-13-2011 07:54 PM

Pretty sure it isn't possible unless you pipe everything through othersite.com/link1 and even then the url from before can be passed on.

Trying to pull a dodgy?

PSD 03-13-2011 08:10 PM

Only way I know of is if the page on othersite.com/link1 has a meta refresh tag like

<meta http-equiv="refresh" content="0;url=http://finalsite.com/" />

but that has its own issues.

Jakez 03-13-2011 08:12 PM

Quote:

Originally Posted by georgeyw (Post 17977105)
Pretty sure it isn't possible unless you pipe everything through othersite.com/link1 and even then the url from before can be passed on.

Trying to pull a dodgy?

Well all the links WILL point to and go through othersite.com/link1, but like you said the referrer seems to randomly choose which place it wants to say it came from, and I need something that will show the correct referrer at least 99% of the time.

Not trying to pull anything slick at all, I just want to make sure my statistics are laid out very simple and not showing referrers from all over the place.

Quote:

Originally Posted by JCK (Post 17977121)
Only way I know of is if the page on othersite.com/link1 has a meta refresh tag like

<meta http-equiv="refresh" content="0;url=http://finalsite.com/" />

but that has its own issues.

What type of issues? I don't care about SEO or anything for this, as long as the referrer is correct all the time.


Another example would be if you wanted to skim traffic coming to your site from your trade1 to your trade2 (not what I'm trying to do), the referrer for trade2's stats will usually show as trade1 and not YOUR domain, so you are losing credit for sending trade2 traffic.


Is it an on-page time problem? The redirect needs to happen slower in order to plant the correct referrer URL? Or is it a problem where the surfer needs to click something in order for the referrer to come from that URL? Maybe I'll just have to run some tests.

glowlite 03-13-2011 08:28 PM

How do you send traffic through a redirect URL and change the referrer?

It's called hypertext preprocessor.

~

PSD 03-13-2011 08:31 PM

The referer will be correct every time. The 0 or any other number before the URL inserts the delay before the automatic redirect so with a 0 there is very little if any delay. The acccuracy of the redirect is the same with any delay. The surfer does not need to click anything. One of the issues is the browser back button is not as functional with a short or no delay.

PSD 03-13-2011 08:33 PM

Quote:

Originally Posted by glowlite (Post 17977152)
How do you send traffic through a redirect URL and change the referrer?

It's called hypertext preprocessor.

~

php sends the original page as the referer so does not help but could be used to dynamically insert the final destination domain in the meta refrsh tag.

glowlite 03-13-2011 08:43 PM

Quote:

Originally Posted by JCK (Post 17977164)
php sends the original page as the referer so does not help but could be used to dynamically insert the final destination domain in the meta refrsh tag.

Go back to the books, you seem to have skipped a paragraph or two.

Jakez 03-13-2011 08:45 PM

Quote:

Originally Posted by JCK (Post 17977158)
The referer will be correct every time. The 0 or any other number before the URL inserts the delay before the automatic redirect so with a 0 there is very little if any delay. The acccuracy of the redirect is the same with any delay. The surfer does not need to click anything. One of the issues is the browser back button is not as functional with a short or no delay.

Not as funtional as in? There is no back, or the back button goes to the redirecting URL? Regardless I just need the stats on finalsite.com to show the redirect as the referrer. Thanks for the meta refresh I'm going to try that out. :thumbsup

Quote:

Originally Posted by glowlite (Post 17977172)
Go back to the books, you seem to have skipped a paragraph or two.

As far as I've seen, a PHP redirect does show the original source as referrer. Which is why I'm looking for an alternate solution that will show the redirect as the referrer.

PSD 03-13-2011 08:52 PM

Quote:

Originally Posted by Jakez (Post 17977175)
Not as funtional as in? There is no back, or the back button goes to the redirecting URL? Regardless I just need the stats on finalsite.com to show the redirect as the referrer. Thanks for the meta refresh I'm going to try that out. :thumbsup

There is a back but it goes to the redirecting URL if only clicked once and thus you get a loop. This should accomplish what you want however so give it a try. I don't know what books glowlite is reading but all the ones I have read indicate that redirection does not work in the way you are trying to get it to.

Tempest 03-13-2011 10:24 PM

Use the meta refresh... Helps to filter out some bots as well..

Danmixz 03-13-2011 10:45 PM

PHP Code:

<?php
 

$magic_number 
1234;

$url 'http://www.google.com';



if (isset(
$_GET['mn']) && $_GET['mn']==$magic_number){        

        echo 
'<html><head></head><body><form action="' 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] . '" method="post" id="form1">

<input type="hidden"  name="mn" value="' 
$magic_number '" /></form>

<script language="JavaScript"> 
    document.getElementById(\'form1\').submit();</script></body></html>'
;
        return 
true
        exit();
}

if (
$_POST['mn']==$magic_number){        

    echo 
'<html><head></head><body><form action="' 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] . '" method="post" id="form1">

<input type="hidden"  name="mn" value="' 
$magic_number $magic_number '" /></form>

<script language="JavaScript"> 
    document.getElementById(\'form1\').submit();</script></body></html>'
;
        return 
true
        exit();
}    

$dom preg_replace"/^www\./"""$_SERVER'HTTP_HOST' ] ) ;
$ref$_SERVER['HTTP_REFERER'];


if (((
strpos($ref$dom)!=FALSE) || (trim($ref)=="" ) )  && ($_POST['mn']==$magic_number.$magic_number)){
        
header'Location: ' $url);
        exit();
    }


?>


<html>
  <head>
    <title>Your Fake Page</title>
  </head>
  <body>
    <br><br><br><br>
     <center><h1>Your Fake Page</h1></center>
 
  </body>
</html>

Or use double meta refresh

stonehammer 03-13-2011 10:52 PM

will php redirect work ?? i never tried it before

SmokeyTheBear 03-14-2011 12:54 AM

javascript

Emil 03-14-2011 02:31 AM

Double META-refresh will clean the referer. I think you have to set the META-redirect to 5 seconds to make the new page the referer.

TheDoc 03-14-2011 04:46 AM

Code:

<?php $url = urldecode($_REQUEST[url]);?>
<html><head></head><body onload='top.location="<?=$url;?>"></body></html>


Jakez 03-14-2011 06:49 PM

Quote:

Originally Posted by JCK (Post 17977121)
<meta http-equiv="refresh" content="0;url=http://finalsite.com/" />

Tried this. In Firefox and IE the referrer is left blank on the final page, Chrome is the only one that actually shows a referrer and it shows it correctly as the redirect URL. In Firefox and Chrome the back button on 1 click goes to the original source, IE goes to the redirect page.

Quote:

Originally Posted by Danmixz (Post 17977286)
PHP Code:

 

Or use double meta refresh

Nice, this code works. Tried a double meta refresh and it didn't work, might not have done it correctly though.

Quote:

Originally Posted by TheDoc (Post 17977579)
Code:

<?php $url = urldecode($_REQUEST[url]);?>
<html><head></head><body onload='top.location="<?=$url;?>"></body></html>


WINNING! This works also and is 100x more simple to deal with.

Final code I'm going with for the redirect page:
PHP Code:

<?php $url "http://www.finalsite.com"?>
<html><head></head><body onload='top.location="<?=$url;?>"></body></html>

Shows the redirect as the referrer in all browsers. :thumbsup Thanks everyone!

TheDoc 03-14-2011 08:11 PM

Quote:

Originally Posted by Jakez (Post 17979471)
WINNING! This works also and is 100x more simple to deal with.

Final code I'm going with for the redirect page:
PHP Code:

<?php $url "http://www.finalsite.com"?>
<html><head></head><body onload='top.location="<?=$url;?>"></body></html>

Shows the redirect as the referrer in all browsers. :thumbsup Thanks everyone!

Happy to assist... :thumbsup

Not that it makes any difference really, but if you're going to hard code the url in the php, you might as well take all of the php out and put the url in the location directly.

Either way works though. :upsidedow


All times are GMT -7. The time now is 12:37 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123