文章目录 一、Apache二、SESSION 一、Apache 在.htacess文件上写SetEnvIfNoCase referer “^http://192.168.x.x” local_ref=1 二、SESSION 强制用户必须登录才能访问 //$_SESSION['viewimages'] = true;设置SESSION if(isset($_SESSION['viewimages']) && $_SESSION['viewimage'] == true){ //xxx }else{ header("HTTP/1.1 404 NOT FOUND"); }