basically, what i want to do is redirect all visitors that DO NOT come from website.com. i want to have all variations of website.com redirect to A, and any other website redirect to B. so, website.com, www.website.com, sub1.website.com, website.com/dir1 etc etc all go to A and any other referrer goes to B. how do i do this?
$ref = $_SERVER['HTTP_REFERER']; $desired = 'http://your-desired-reffering-page.com'; if ($ref != $desired) { header('Location:http://site.com/wrong-referer'); } else { header('Location:http://your-site.com/'); } PHP: