一是伪静态配置,需重点做好 HTTP 到 HTTPS 的全局替换规则设置,同时配置防 404 的跳转或适配方案,保障页面访问顺畅;
# --------------- 强制HTTPS + 取消WWW跳转(你的主域名:lifetruth.top)---------------
RewriteEngine On
# 1. HTTP 强制跳转 HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# 2. 带www 强制跳转到 不带www(主域名)
RewriteCond %{HTTP_HOST} ^www\.lifetruth\.top$ [NC]
RewriteRule ^(.*)$ https://lifetruth.top/$1 [L,R=301]
# --------------- WordPress 原生伪静态(保留原有全部功能)---------------
# BEGIN WordPress
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
二是 CSS 样式备份,需留存调整好的页面显示比例、布局样式等关键代码,避免迁移后页面排版错乱;
.container, .pc-container {
max-width: 80% !important; /* 容器宽度为视口宽度的80% */
width: 100% !important;
margin-left: auto !important; /* 确保容器水平居中 */
margin-right: auto !important;
}
@media (max-width: 768px) {
.container, .pc-container {
max-width: 99% !important; /* 在小屏幕上使用更宽的占比,留出少量边距 */
}
}
/* 正文 */
body, p {
font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
font-size: 16px;
line-height: 1.8;
color: #333;
}
/* 标题 */
h1, h2, h3, h4, h5, h6 {
font-family: "Microsoft YaHei", "SimHei", sans-serif;
font-weight: bold;
}
/* 文章内容区域 */
.entry-content, .post-content {
font-family: "Microsoft YaHei", sans-serif;
font-size: 17px;
}
三是文章推送设置备份,记录每次更新文章后需推送的目标站点列表及操作流程,确保内容同步效率。所有配置均为亲测可用的实操记录,是网站迁移时的核心参考手册。
https://rpc.pingomatic.com/
http://ping.baidu.com/ping/RPC2
https://blogping.360.cn/
http://www.sogou.com/ping/RPC2
正文完