通过判断访问来源来实现。
$fromurl="http://www.111.com/index.php"; //只能从这个地址访问if( $_SERVER['HTTP_REFERER'] != $fromurl ){ header("Location:".$fromurl); exit;}不好意思。理解错误。。。改一下代码。。$fromurl="http://www.111.com/index.php"; //跳转往这个地址。if( $_SERVER['HTTP_REFERER'] == "" ){ header("Location:".$fromurl); exit;}