我从许多垃圾邮件推荐域中得到了相同的信息,并且我想共享一个PHP代码,您可以将其包含在header.php或其他内容中。
使用此代码,您可以将垃圾邮件域重定向到其自身。
<?php
$spams = array (
"hardcore.anzwers.net",
"femmesdenudees.com",
"villagedusexe.com",
"gratuitbaise.com",
"inbabes.sexushost.com",
"mature.free-websites.com",
"simple-share-buttons.com",
"darodar.com",
"social-buttons.com",
"hulfingtonpost.com",
"get-free-traffic-now.com",
"buttons-for-website.com",
"4webmasters.org",
"4webmasters.com",
"ranksonic.org",
"ranksonic.com",
);
// array of evil spammers
$ref = $_SERVER["HTTP_REFERER"];
foreach ($spams as $site) {
$pattern = "/$site/i";
if (preg_match ($pattern, $ref)) {
header("Location: $ref"); exit();
}
}
?>
并可以将其保存为“ no-refer-spam.php”,如下所示(例如在“ header.php”中):
<?php
if(file_exists('no-refer-spam.php')){
require('no-refer-spam.php');
}
?>