0
我想只允許來自某個推薦網址的流量訪問我的網站,如「example.com/123」。我想讓其餘的流量在延遲一段時間(例如1或2分鐘)後重定向到相同的引用URL。我希望來自example.com/123的流量 不再被引用。如何根據引用來重定向和/或延遲?
我想用這樣的事情,但我不知道如何修改,以滿足我的要求:
<?php
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/site1.com/",$referrer)) {
header('Location: http://www.customercare.com/page-site1.html');
} elseif (preg_match("/site2.com/",$referrer)) {
header('Location: http://www.customercare.com/page-site2.html');
} else {
header('Location: http://www.customercare.com/home-page.html');
};
?>