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

推荐订阅源

G
Google Developers Blog
V
Vulnerabilities – Threatpost
A
Arctic Wolf
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
H
Hacker News: Front Page
D
Docker
人人都是产品经理
人人都是产品经理
Attack and Defense Labs
Attack and Defense Labs
Forbes - Security
Forbes - Security
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
aimingoo的专栏
aimingoo的专栏
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Simon Willison's Weblog
Simon Willison's Weblog
腾讯CDC
WordPress大学
WordPress大学
T
Tenable Blog
P
Proofpoint News Feed
月光博客
月光博客
T
Tor Project blog
The Cloudflare Blog
罗磊的独立博客
S
Secure Thoughts
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The Hacker News
The Hacker News
P
Palo Alto Networks Blog
I
Intezer
小众软件
小众软件
N
News | PayPal Newsroom
V
Visual Studio Blog
L
LINUX DO - 最新话题
W
WeLiveSecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Troy Hunt's Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
D
DataBreaches.Net
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security Affairs
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
阮一峰的网络日志
阮一峰的网络日志

别年

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