Skip to content

Commit 69e26cb

Browse files
xkcodingclaude
andcommitted
fix: 修正 Hexo 旧链接重定向规则
旧链接格式: /YYYY/MM/DD/slug.html 新链接格式: /YYYY-MM-DD-slug.html Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent eb9b99a commit 69e26cb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

nginx-ssl.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ server {
7979
}
8080

8181
# ==================== 旧链接重定向 ====================
82-
# Hexo 旧链接格式: /YYYY/MM/DD/slug.html → /posts/slug/
83-
location ~ "^/[0-9]{4}/[0-9]{2}/[0-9]{2}/(.+)\.html$" {
84-
return 301 /posts/$1/;
82+
# Hexo 旧链接格式: /YYYY/MM/DD/slug.html → /YYYY-MM-DD-slug.html
83+
location ~ "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.+)\.html$" {
84+
return 301 /$1-$2-$3-$4.html;
8585
}
8686

8787
# 主路由

0 commit comments

Comments
 (0)