Skip to content

Commit 7b0ed0a

Browse files
committed
fix(seo): 统一主域 301 重定向并添加百度站点验证文件
- nginx.conf: 新增 www → 非 www 的 301 重定向,收敛 SEO 权重 - website/public: 添加百度站点验证文件 baidu_verify_codeva-Qu8yr0Jrfu.html
1 parent 4afe65e commit 7b0ed0a

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎server/nginx/nginx.conf‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,27 @@ http {
6767
}
6868
}
6969

70+
# www → 非 www 统一主域(SEO 权重收敛)
71+
# Why: canonical/sitemap 均以非 www 为准;双域名并存会被搜索引擎视为两个站点,
72+
# 权重分裂导致排名下降。www 全部 301 至主域。
73+
server {
74+
listen 443 ssl;
75+
server_name www.entropydecrease.com;
76+
77+
# SSL 证书(由 Certbot / Let's Encrypt 签发,覆盖 www 子域)
78+
ssl_certificate /etc/nginx/certs/fullchain.pem;
79+
ssl_certificate_key /etc/nginx/certs/privkey.pem;
80+
ssl_protocols TLSv1.2 TLSv1.3;
81+
ssl_ciphers HIGH:!aNULL:!MD5;
82+
ssl_prefer_server_ciphers on;
83+
84+
return 301 https://entropydecrease.com$request_uri;
85+
}
86+
7087
# HTTPS 主服务
7188
server {
7289
listen 443 ssl;
73-
server_name entropydecrease.com www.entropydecrease.com;
90+
server_name entropydecrease.com;
7491

7592
# SSL 证书(由 Certbot / Let's Encrypt 签发)
7693
ssl_certificate /etc/nginx/certs/fullchain.pem;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cfe09af4999a5031868fff1c9f64f42d

0 commit comments

Comments
 (0)