比塔Blog

个人建站域名相关问题

Feb 13, 2026
建站 建站
2分钟
281字

www or no-www

选择www,no-www重定向

http or https

全部https,http重定向

域名解析配置

在阿里云域名解析中,配置www.bitab.net和@.bitab.net,后者表示的就是域名bitab.net

nginx配置

defualt

1
server {
2
listen 80;
3
listen 443 ssl;
4
5
listen [::]:80;
6
listen [::]:443 ssl;
7
8
server_name vnotes.cn
9
bitab.net;
10
11
return 301 https://www.$host$request_uri;
12
}
13
14
server {
15
listen 80;
7 collapsed lines
16
listen [::]:80;
17
18
server_name www.vnotes.cn web.vnotes.cn
19
www.bitab.net blog.bitab.net;
20
21
return 301 https://$host$request_uri;
22
}

bitab

1
server {
2
listen 443 ssl http2;
3
listen [::]:443 ssl http2;
4
server_name www.bitab.net;
5
ssl_certificate /var/www/TSL/www.bitab.net.pem;
6
ssl_certificate_key /var/www/TSL/www.bitab.net.key;
7
8
if ($request_uri ~ "^(.*)/index\.html$") {
9
return 301 $1/;
10
}
11
12
root /var/www/bitab/dist;
13
index index.html index.htm;
14
15
location / {
22 collapsed lines
16
try_files $uri $uri/ =404;
17
}
18
}
19
20
server {
21
listen 443 ssl http2;
22
listen [::]:443 ssl http2;
23
server_name blog.bitab.net;
24
ssl_certificate /var/www/TSL/blog.bitab.net.pem;
25
ssl_certificate_key /var/www/TSL/blog.bitab.net.key;
26
27
if ($request_uri ~ "^(.*)/index\.html$") {
28
return 301 $1/;
29
}
30
31
root /var/www/blog-bitab/dist;
32
index index.html index.htm;
33
34
location / {
35
try_files $uri $uri/ =404;
36
}
37
}

index.html问题

1
# 全站去掉 index.html,SEO 去重
2
if ($request_uri ~ "^(.*)/index\.html$") {
3
return 301 $1/;
4
}

见index配置 检查网页中的网址

另外加固可以在你所有页面的 里加上:

1
<link rel="canonical" href="https://www.你的域名.com<?php echo $_SERVER['REQUEST_URI']; ?>">

感觉没必要,还要有PHP脚本支持

证书申请

申请*.bitab.net的证书,这样子域名都可以用,但阿里云免费版的证书只能单独申请

app配置

https://www.bitab.net build完成后,检查sitemap

CDN配置

waiting

本文标题:个人建站域名相关问题
文章作者:比塔网
发布时间:Feb 13, 2026
| 本网站已访问: | 总访客:
比塔网: bitab.net             备案号: 闽ICP备2024035729号-2             email: vnotes@126.com