使用方法,选择以下代码添加到 文章的404页面 (404.php)
第一种,直接跳转
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo("url"));
exit();
?>
第二种,直接跳转
<?php
//WordPress 301 跳转到网站首页
wp_redirect(home_url(), 301);exit;
?>
第三种,直接载入首页 返回 404 状态
<?php
//直接载入首页 返回 404 状态
global $wp_query;
$wp_query->set_404();
status_header(404);
nocache_headers();
include( get_query_template( 'index' ) );
die();
?>
第四种,返回 404 状态,然后通过 html 刷新跳转到首页
<?php
//返回 404 状态,然后通过 html 刷新跳转到首页
global $wp_query;
$wp_query->set_404();
status_header(404);
nocache_headers();
echo '<meta http-equiv="refresh" content="0;url='.home_url().'">';
exit;
?>
https://www.zmki.cn/5722.html
iP反查域名网站
https://site.ip138.com/
屏蔽垃圾蜘蛛
在网站 配置文件修改。
if ($http_user_agent ~* (SemrushBot|python|Linespider|crawler|DingTalkBot|simplecrawler|ZoominfoBot|zoombot|Neevabot|coccocbot|Facebot|YandexBot|Adsbot|DotBot|Applebot|DataForSeoBot|MJ12bot|BLEXBot|trendictionbot0|trendictionbot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup)) {
return 444;
}
if ($http_user_agent ~* (SemrushBot|DotBot|MJ12bot|AhrefsBot|MauiBot|MegaIndex.ru|BLEXBot|ZoominfoBot|ExtLinksBot|hubspot|leiki|webmeup)) {
return 403;
}