原因
由于我的博客绑定的域名是www.imcry.vip。
有博主反馈,在直接访问imcry.vip时并不会自动跳转到www.imcry.vip。
域名在使用阿里云DNS解析时可以直接添加@记录的显性URL跳转。
不过博主在切换到华为云的DNS解析后因为不是企业认证导致无法添加此类型的记录。
解决
使用Edge-Pages部署一个跳转页面。
页面代码
使用DeepSeek简单搓了个秒跳转的页面。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
| <!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>初然忆 - 正在跳转…</title>
<meta http-equiv="refresh" content="0; url=https://www.imcry.vip/" />
<style>
/* 简洁美观的跳转提示页样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #f8fafc;
padding: 20px;
}
.card {
max-width: 480px;
width: 100%;
background: #ffffff;
border-radius: 20px;
padding: 48px 40px;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
text-align: center;
transition: all 0.2s;
}
.icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 72px;
height: 72px;
border-radius: 50%;
background: #eef2ff;
color: #4f46e5;
font-size: 32px;
margin-bottom: 24px;
}
h1 {
font-size: 22px;
font-weight: 600;
color: #0f172a;
letter-spacing: -0.3px;
margin-bottom: 10px;
}
p {
font-size: 16px;
color: #64748b;
line-height: 1.6;
margin-bottom: 28px;
}
.url-box {
display: inline-block;
background: #f1f5f9;
padding: 8px 20px;
border-radius: 40px;
font-size: 15px;
font-weight: 500;
color: #0f172a;
word-break: break-all;
margin-bottom: 8px;
}
.spinner {
display: inline-block;
width: 22px;
height: 22px;
border: 3px solid #e2e8f0;
border-top-color: #4f46e5;
border-radius: 50%;
animation: spin 0.7s linear infinite;
margin-top: 8px;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.footer {
margin-top: 24px;
font-size: 13px;
color: #94a3b8;
}
.footer a {
color: #4f46e5;
text-decoration: none;
}
.footer a:hover {
text-decoration: underline;
}
/* 暗色适配 */
@media (prefers-color-scheme: dark) {
body {
background: #0f172a;
}
.card {
background: #1e293b;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
h1 {
color: #f1f5f9;
}
p {
color: #94a3b8;
}
.url-box {
background: #334155;
color: #f1f5f9;
}
.spinner {
border-color: #475569;
border-top-color: #818cf8;
}
.icon {
background: #1e293b;
color: #818cf8;
}
.footer {
color: #64748b;
}
.footer a {
color: #818cf8;
}
}
/* 小屏优化 */
@media (max-width: 480px) {
.card {
padding: 32px 24px;
}
h1 {
font-size: 19px;
}
}
</style>
</head>
<body>
<div class="card">
<!-- 图标 -->
<div class="icon">↗</div>
<h1>正在跳转</h1>
<p>
您正在被重定向至 初然忆<br />
<span class="url-box">www.imcry.vip</span>
</p>
<!-- 加载动画 -->
<div class="spinner"></div>
<div class="footer">
若未自动跳转,请 <a href="https://www.imcry.vip/">点击此处</a>
</div>
</div>
<!-- JavaScript 重定向(优先执行,浏览器兼容性最好) -->
<script>
(function() {
var target = 'https://www.imcry.vip/';
// 使用 replace 避免在浏览器历史中留下当前页
window.location.replace(target);
})();
</script>
</body>
</html>
|
部署Pages
博主的域名是备案过的,因此选择国内厂商的Pages服务是最优选择。
阿里云ESA的Pages有请求次数的限制,进而博主将目光转向腾讯的Edge-Pages。
测试
部署完毕后,等待全球DNS服务器刷新后,访问 https://imcry.vip
观察到页面会立即跳转至 https://www.imcry.vip