Make a fake referer

juan186

Registered Member
Joined
Sep 16, 2015
Messages
55
Reaction score
13
Hi guys, I want to make a fake referer. I have 2 blogs myfirstblog.com and mysecondblog.com I want to bring traffic with facebook to myfirstblog.com, and that the referer would be mysecondblog.com

Is it possible? I read a tutorial in this forum, but the script in php doesn't work.

Thanks
 
I've looked over the guides listed above the question I have is with them being so old are they even relavant anymore?
 
Hi.

Why don't you just make a redirection.

Yo make a page like redirect.php on mysecondblog

Code:
<?php
header("Location: url of first blog");
exit();
?>

And on facebook you put a link : secondblog/redirect.php

You send traffic and it will be good :D
 
Last edited:
Hi.

Why don't you just make a redirection.

Yo make a page like redirect.php on mysecondblog

Code:
<?php
header("Location: url of first blog");
exit();
?>

And on facebook you put a link : secondblog/redirect.php

You send traffic and it will be good :D

No that's a 301 redirect and most browser will keep the orginal referer (and it's normal since it's more logical), if you want to change it this should work:

WARNING: This code contain a fail safe, if the referer can't be changed the traffic will not be redirected! This is for education only use it at your own risk!
PHP:
<?php
if(isset($_GET['redir']) && !empty($_GET['redir'])) {
    $redir_url = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], "=") + 1);
    $refresh_url = 'http://' . $_SERVER['HTTP_HOST'] . strtok($_SERVER["REQUEST_URI"],'?');
    setcookie("redir", $redir_url, time()+5);
    exit(header('Location: ' . $refresh_url));
}
elseif(isset($_COOKIE['redir']) && !empty($_COOKIE['redir'])) {
    $referer = $_SERVER['HTTP_REFERER'];
    $domain = $_SERVER['HTTP_HOST'];
    if(strpos($referer, $domain) !== false) {
        $redir_url = urldecode($_COOKIE['redir']);
        setcookie("redir", "", time()-5);
        exit(header('Location: ' . $redir_url));
    } else {
        echo '<form action="" method="get"></form>';
        echo '<script>document.forms[0].submit();</script>';
    }
}
?>
Send traffic to 'http://mydomain.com?redir=http://redirdomain.com' (where 'http://redirdomain.com' is the url where you want to send traffic to).
 
Last edited:
I have a working redirection written in PHP that works on both PHP coded sites, including Wordpress.
The problem is, I'm still a newbie and not allowed to post links. Code has links so it won't get posted anyway.

Later when I'm allowed to post links, I'll share it here in BHW.
 
Back
Top