I try like following but it doesn’t work in sometimes.
<?php
$refer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
if( preg_match("/anysite1/i", $refer) or preg_match("/anysite2/i", $refer) or preg_match("/anysite3/i", $refer) ) {
echo '<script type="text/javascript">';
echo 'window.location.replace("hxxps://mysite.com/get/detail")';
echo '</script>';
}
?>
Sometimes, when I visit from anysite1.tld. It not redirect to hxxps://mysite.com/get/detail.
How can I fixed this code?
Thank you