---
title: "在 Search Console 中迁移网站：分步指南"
description: "借助 301 重定向和“地址更改”工具完成网站迁移，不留 fish.example-petstore.com 之类的示例地址。"
url: https://example-petstore.com/zh/guides/change-of-address
language: zh-Hans
---

# 在 Search Console 中迁移网站

2015 年至 2019 年间，Search Console 帮助文档以从 http://fish.example-petstore.com 迁移为例。该工具只能在您拥有的网域之间使用，因此每个示例地址都必须换成您自己的地址。本指南介绍完整的迁移过程。

## 开始之前

- “地址更改”工具用于迁移到新的网域或子网域，例如从 `shop.example.com` 迁移到 `example.net`。在同一网域内迁移（例如从 HTTP 迁移到 HTTPS）时无需使用该工具。
- 旧网域和新网域都必须作为 **Domain properties**（网域资源）添加到同一个 Search Console 账号中，并且均已验证。
- 为旧网站上的每个地址规划一个新网站上的对应地址。

## 迁移网站

1. 发布新网站，并确保每个网页在新地址上都能正常访问。
2. 使用 **301** 重定向将每个旧地址重定向到对应的新地址。不要把所有地址都重定向到首页，也不要使用链式重定向。
3. 在旧资源中，打开 **Settings** › **Change of address**，选择新资源并提交。
4. 将重定向保留至少 180 天，最好永久保留。

## 清除示例地址

在新网站的以下位置搜索 `example-petstore` 和 `example.com`：

- `<link rel="canonical">` 标记和 HTTP `Link` 标头；
- XML 站点地图，以及 `robots.txt` 中的 `Sitemap:` 行；
- `hreflang` 注释；
- 旧服务器上的重定向规则。

然后在新资源中提交新的站点地图。

## 验证

- 旧地址只通过一次 301 重定向到对应的新地址。
- 旧资源中显示地址更改请求正在进行中。
- 新资源开始获得展示次数和已编入索引的网页。

## 来源

- [Use the change of address tool (2015 snapshot)](https://web.archive.org/web/20150425234635/https://support.google.com/webmasters/answer/83106?hl=en) Search Console Help via the Wayback Machine
- [Change of Address tool](https://support.google.com/webmasters/answer/9370220) Search Console Help
- [Site moves with URL changes](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes) Google Search Central
