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

推荐订阅源

B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Martin Fowler
Martin Fowler
GbyAI
GbyAI
P
Palo Alto Networks Blog
N
Netflix TechBlog - Medium
C
Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
Scott Helme
Scott Helme
TaoSecurity Blog
TaoSecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
W
WeLiveSecurity
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
月光博客
月光博客
N
News | PayPal Newsroom
Microsoft Azure Blog
Microsoft Azure Blog
G
GRAHAM CLULEY
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Know Your Adversary
Know Your Adversary
博客园 - Franky
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
MyScale Blog
MyScale Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog

别年

基于 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 许可协议。