Typecho 安装的默认后台路径是 example.com/admin/ 为了提高安全性,我们可以让后台地址以 example.com/xxxxx/ 的方式访问,其中xxxxx 是你自定义的路径。

首先登陆主机后台,将Typecho程序根目录中的后台文件夹"admin"重命名,名字即为你想自定义的地址名,例如:将"admin"改为"xxxxx"。

然后在根目录找到 "config.inc.php" 的文件,大概在13行的位置找到以下代码

// admin directory (relative path)

define('__TYPECHO_ADMIN_DIR__', '/admin/');

将代码中admin改为xxxxx。这样我们的Typecho程序网站的后台就改成:域名example.com/xxxxx/了。

做完上面的操作后,你可以在网站根目录新建一个admin文件夹,然后里面放一个仿 FBI Warning 的index.html 页面对非法访问进行警告。


复制下面的源码到新建的 index.html 保存即可。

<html>
<head>
<title>HERESY WARNING</title>
</head>
<body>
<style>
body {
background:#000;}
.warning-title {
margin-top:8%;
margin-left:auto;
margin-right:auto;
width:140px;
background:#f33;
color:#eee;
text-shadow:0 0 1px #fff;
font-size:18px;
text-align:center;}
 
.warning-content {
margin-top:4%;
margin-left:auto;
margin-right:auto;
width:740px;
}
 
.warning-content .cn {
color: #ddd;
text-shadow:0 0 2px #fff;
font-size:18px;
}
 
.warning-content .en {
color: #ddd;
text-shadow:0 0 2px #fff;
font-size:18px;
}
 
p {
margin:15px auto;
}
</style>
<div class="main">
<div class="warning-title">WARNING</div>
<div class="warning-content">
<div class="en">
<p>Serious warning ! The system has detected your current unfriendly behavior.</p>
<p>Please immediately stop illegal operations such as website infiltration and password cracking.
The IP address and other network information you are currently using have been automatically recorded
and highlighted. If it causes any loss to our website or is required by relevant national regulatory
authorities, we will unconditionally cooperate in submitting it.</p>
<p>Please abide by the law, abide by morality, and cherish freedom !</p>
</div>
</div>
</div>
</body>
</html>