js 級別的解決方案雖然能夠讓惡意代理頁面跳回來,但是對搜索引擎不怎么友好。下面是服務(wù)器端(PHP)的解決方案,代碼比較簡單,就不多說了。
$proxy_rs = $this -> proxy_filter();if( $proxy_rs != 'nowamagic.net' || $proxy_rs != 'www.nowamagic.net' ) { echo '非法反向代理訪問'; //header('Location: http://www.nowamagic.net/'); exit;} public function proxy_filter(){ /* $svrUrl = 'http://' . $_SERVER['SERVER_NAME'].$_SERVER["PHP_SELF"]; if (!empty($_SERVER["QUERY_STRING"])) { $svrUrl .= "?".$_SERVER["QUERY_STRING"]; } return $svrUrl; */ return $_SERVER['SERVER_NAME'];}歡迎光臨 WDlinux官方論壇 (http://ahbydz.com/bbs/) | Powered by Discuz! 7.2 |