随手记
// 检查是否直接访问本页面
if( isset($_SERVER['HTTP_REFERER']) ) {
$url_array = explode('http://', $_SERVER['HTTP_REFERER']);
$url = explode('/', $url_array[1]);
if($_SERVER['SERVER_NAME'] != $url[0]) {
// 您不是从本站来的;
header('HTTP/1.1 404 Not Found');
header("status: 404 Not Found");exit;
}
} else {// 禁止直接访问此页;
header('HTTP/1.1 404 Not Found');
header("status: 404 Not Found");exit;
}