[color=rgb(51, 51, 51)][font=Arial, "]网站做大一定规模后,很多站长就会发现很多恶意访问者在不断的试探自己的网站后台密码。
[color=rgb(51, 51, 51)][font=Arial, "]今天为大家提供一种解决办法。
[color=rgb(132, 132, 132)][backcolor=rgb(255, 255, 255)][font=Arial, "] 实现效果:非管理员访问admin.php直接返回404,无法打开页面
[color=rgb(132, 132, 132)][backcolor=rgb(255, 255, 255)][font=Arial, "]
[color=rgb(51, 51, 51)]打开admin.php文件,找到:
[color=rgb(132, 132, 132)][backcolor=rgb(255, 255, 255)][font=Arial, "][indent]$discuz->init();
[/indent][color=rgb(51, 51, 51)]换行,在其下添加代码:
[indent]if(!$_G['uid'] || !getstatus($_G['member']['allowadmincp'], 1)) {
echo(\"404 Not Found\");
exit;
}
[/indent][color=rgb(132, 132, 132)][backcolor=rgb(255, 255, 255)][font=Arial, "]即可。