0

I am unable to catch the Referrer using PHP:

$_SERVER['HTTP_REFERER'];

when visitors come to mywebsite.com from an external-web-site.com via a link with target="_blank", for ex:

   ...    
   <a href="http://mywebsite.com" target="_blank">Link to My WebSite</a>
   ...

It always returns empty result instead of the external-web-site.com

Does it possible to correctly obtain external-web-site.com, lets say using combination of JavaScript and PHP or something else?

Thanks in advance!

1 Answers1

0

I think i found this problem solution. I am suggesting that i have one php file. So i want direct and _blank link rediret ru.example.com and referred link az.example.com. And i have this link az.example.com/index.php?id=123 i want _blank link from facebook.com or another site my page not redirect. Only redirect index.php

so

index.php source code:

<?php
$refer = $_SERVER['HTTP_REFERER'];
...
if($id<>null){
...
}else{
if($refer==null){
header('Location:http://ru.example.com/');
}
...
}
?>