Подменить referrer на любой какой хочется не получится, разве только полной проксификацией целевой страницы с помощью curl
PHP код:
<?php
echo geturl('https://www.whatismyreferer.com', 'https://www.google.com');
function geturl($url, $referer) {
$headers[] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg,text/html,application/xhtml+xml';
$headers[] = 'Connection: Keep-Alive';
$headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
$useragent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36';
$process = curl_init($url);
curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_USERAGENT, $useragent);
curl_setopt($process, CURLOPT_REFERER, $referer);
curl_setopt($process, CURLOPT_TIMEOUT, 30);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 0);
$return = curl_exec($process);
curl_close($process);
return $return;
}
?>
Полностью удалить referrer можно автокликером как тебе советуют
PHP код:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Clear Referrer</title>
</head>
<body>
<a rel="noreferrer" id="redirect" style="display:none;"></a>
<script>
var e = document.getElementById("redirect");
e.href = "https://www.whatismyreferer.com";
e.click();
</script>
</body>
</html>
НО в большинстве сетей требуют чтоб referrer был не пустой. В таком случае поможет следущий вариант.
На своем домене
https://yourdomain.com создаешь три страницы - page1.php, page2.php, index.php
Содержание page1.php
PHP код:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0;url='https://yourdomain.com/page2.php'">
<title>Page 1</title>
</head>
<body>
</body>
</html>
Содержание page2.php
PHP код:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0;url='https://yourdomain.com'">
<title>Page 2</title>
</head>
<body>
</body>
</html>
Содержание index.php
PHP код:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Landing Page</title>
</head>
<body>
Привет, я Landing Page с которой к тебе приходит весь мой трафик
<script>
var ref;
ref = document.referrer;
if (ref.replace("https://yourdomain.com/page2.php", "") != ref) {
window.location.href = 'https://www.whatismyreferer.com'; // тут линк на сайт злых дядек
}
</script>
</body>
</html>
Трафик с источника который нужно спрятать пускашь на
https://yourdomain.com/page1.php
Происходи серия редиректов page1.php >> page2.php >> index.php >> offer
Злые дядьки будут видеть в referrer
https://yourdomain.com/ при переходе на который они увидят легальный лендос.