I was wanting to have a page where if a visitor comes from a certain referrer it would redirect to another site, but if the visitor comes from any other referrer the page would load as normal. The one caveat though is that if I redirect a visitor I want to strip the referrer info when redirecting them.
Does a PHP header redirect(as below) strip referrer info to the site it's being redirected to or would I have to do some other kind of redirect in order to do that? Meta redirect maybe? Can you even use a meta redirect in a PHP script?
Does a PHP header redirect(as below) strip referrer info to the site it's being redirected to or would I have to do some other kind of redirect in order to do that? Meta redirect maybe? Can you even use a meta redirect in a PHP script?
PHP:
<?php
$referrer=$_SERVER[‘HTTP_REFERER’];
if (preg_match("example.com/",$referrer))
header('Location: http://www.example2.com/');
?>