惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
Know Your Adversary
Know Your Adversary
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
AI
AI
O
OpenAI News
M
MIT News - Artificial intelligence
Scott Helme
Scott Helme
U
Unit 42
P
Proofpoint News Feed
罗磊的独立博客
C
Check Point Blog
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
I
InfoQ
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
Webroot Blog
Webroot Blog
P
Palo Alto Networks Blog
C
Cybersecurity and Infrastructure Security Agency CISA
N
News and Events Feed by Topic
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
A
About on SuperTechFans
美团技术团队
J
Java Code Geeks
T
Tenable Blog
L
LINUX DO - 最新话题
NISL@THU
NISL@THU
G
Google Developers Blog
Forbes - Security
Forbes - Security
爱范儿
爱范儿
S
Security @ Cisco Blogs
Project Zero
Project Zero
有赞技术团队
有赞技术团队

别年

基于 Cloudflare Workers 部署博客 AI 摘要服务 博客主题个人巧思 1% 尝试用 AI 重构 Folo Transform 的使用体验 怎么就八月了 Waline 配置 Resend 邮箱提醒 Cloud Mail:基于 Cloudflare Workers、Resend 的自有域名邮箱服务搭建 免疫系统的劫数 摸黑向前:瞎练之后瞎吃 優しい雨が降りますように 天津|挑战陌生的开端 免费企业邮箱:Gmail、Resend 邮件代发配置 落笔于向日葵花开的谷雨尾声 付鹏:未来三五年最确定的投资机会(20250413) 使用 ClawCloud Run 部署 AList 咸阳印象:关中秦风的千年回响 速回博客问卷 记于春分李树花开一刻 借助 Algolia DocSearch 实现站内搜索 新手父母避坑指南:0-3岁育儿用品、疫苗与经历
Vercel 重定向与 Google Search Console 地址更改
Xuesong · 2025-04-07 · via 别年

之前使用 Cloudflare Workers 部署的 308 重定向解决了子域名(some.fylsen.com)到主域名(fylsen.com)的跳转问题,但是最近发现很多旧域名的流量来源是 Google 之类的搜索引擎,应该是旧地址还是占据着搜索结果。这次趁着迁移回 Vercel 进行部署,直接原生实现重定向并提交 Google 变更地址。

设置 Vercel 301 重定向

Vercel 通过在项目根目录下创建 Vercel.json 进行配置实现路由重定向,具体可以参考 Redirects 文档。

json

{
  "redirects": [
    {
      "source": "/posts/setup-mingw64-msys-environment-on-64-bit-windows-7",
      "destination": "/posts/2014/02/setup-mingw64-msys-environment-on-64-bit-windows-7",
      "statusCode": 301
    },
    {
      "source": "/posts/setup-mingw64-msys-environment-on-64-bit-windows-7/",
      "destination": "/posts/2014/02/setup-mingw64-msys-environment-on-64-bit-windows-7/",
      "statusCode": 301
    },
    {
      "source": "/posts/fading-sunset-new-journey",
      "destination": "/posts/2025/02/fading-sunset-new-journey",
      "statusCode": 301
    }
    ...
}

规则说明

  • source: 原始路径,访问者请求的 URL 路径
  • destination: 目标路径,重定向后的新 URL 路径
  • statusCode: HTTP 状态码,301 表示永久重定向

构建之后可以看到已经成功创建了对应文件 vercel.json 文件。

vercel.json

设置中完成子域名的重定向,选择 301 状态码。

子域名重定向

设置 Google Search Console 的地址更改

Google Search Console 中提供了 Change of Address,可以参考官方文档地址更改工具部分。

  1. 登录 Google Search Console
  2. 选择你要迁移的旧网站属性(如:some.fylsen.com)
  3. 左侧导航栏中点击:设置(Settings) → 地址变更(Change of Address) Change of Address
  4. 选择新域名(如:fylsen.com)
  5. 系统会验证新域、检查重定向是否正确、sitemap 是否有效,之后等待迁移完成 Detail

文章标题:Vercel 重定向与 Google Search Console 地址更改

文章作者:Xuesong

文章链接:https://fylsen.com/posts/2025/04/vercel-301-redirects-google-search-console-address-change[复制]

最后修改时间:


商业转载请联系站长获得授权,非商业转载请注明本文出处及文章链接,您可以自由地在任何媒体以任何形式复制和分发作品,也可以修改和创作,但是分发衍生作品时必须采用相同的许可协议。
本文遵循 CC BY-NC-SA 4.0 许可协议。