更改网站地址Change a site address

备注

此功能不适用于 Microsoft 365 政府版 GCC 高级版客户。This feature is not available for Microsoft 365 Government GCC High customers.

作为组织中的全局管理员或 SharePoint 管理员,您可以更改以前称为 "网站集" ) 的 SharePoint 网站类型的 URL (:As a global or SharePoint admin in your organization, you can change the URL for the following types of SharePoint sites (previously called "site collections"):

  • Microsoft 365 组连接的团队网站Microsoft 365 group-connected team sites
  • 不属于 Microsoft 365 组的新式工作组网站Modern team sites that don't belong to a Microsoft 365 group
  • 通信网站Communication sites
  • 经典团队网站Classic team sites

备注

如果发布功能当前已激活或之前已为网站激活,则不支持更改网站地址。If the Publishing feature is currently activated or was previously activated for the site, then changing the site address is unsupported.

您可以仅更改 URL 中的网站地址,例如:You can change only the address of the site within the URL, for example:

https:// com/网站/projectxhttps://contoso.sharepoint.com/sites/projectx
到 https:// contoso. sharepoint。 com/网站/projectyto https://contoso.sharepoint.com/sites/projecty

您不能更改上一示例中的域 ( "contoso") 或路径的任何其他部分。You can't change the domain ("contoso" in the previous example) or any other part of the path. 例如,不能将网站从 "/sites" 移动到 "/teams."For example, you can't move the site from "/sites" to "/teams."

可能需要大约10分钟的时间来更改网站地址 (具体取决于网站) 的大小,在此期间网站将是只读的。It can take about 10 minutes to change the site address (depending on the size of the site), and the site will be read-only during this time. 建议在网站使用率较低时更改地址。We recommend changing addresses during times when site usage is low.

您可以一次更改最高为100个网站的地址。You can change the address of up to 100 sites at a time. 若要更改其他网站地址,请等待其他更改完成。To change an additional site address, wait for another change to finish.

将地址更改传达给用户Communicate the address change to users

在更改网站地址之前,重要的是,将更改传递给网站用户 (通常任何人都可以编辑或查看网站) 。Before you change the address of a site, it's important to communicate the change to site users (generally anyone with the ability to edit or view the site). 这可帮助减少用户困惑和致电技术支持的次数。This can help reduce user confusion and calls to your help desk. 查看 更改网站地址的影响,并让用户了解以下信息:Review the effects of changing a site address and let users know the following information:

  • 更改将在何时发生When the change will happen
  • 新 URL 将是什么What the new URL will be
  • 用户应在地址更改期间关闭文件,而不进行编辑Users should close their files and not make edits during the address change
  • 用户应检查网站回收站以确保其不包含要保留的文件Users should check the site recycle bin to make sure it contains no files they want to keep
  • 文件权限和共享不会更改File permissions and sharing won't change

在新 SharePoint 管理中心中更改网站地址Change a site address in the new SharePoint admin center

  1. 转到新的 SharePoint 管理中心的“活动网站”页,然后使用在组织中具有管理员权限的帐户进行登录。Go to the Active sites page of the new SharePoint admin center, and sign in with an account that has admin permissions for your organization.

备注

如果使用的是 Office 365 Germany,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“活动站点”页面。 If you have Office 365 Germany, sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Active sites page.
如果使用的是由世纪互联(中国)运营的 Office 365,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“活动站点”页面。If you have Office 365 operated by 21Vianet (China), sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Active sites page.

  1. 若要打开 "详细信息" 窗格,请选择网站名称。To open the details pane, select the site name.

  2. 在 " 常规 " 选项卡上的 "URL" 下,选择 " 编辑"。On the General tab, under URL, select Edit.

    更改网站地址

  3. 输入新的网站地址,然后选择 " 保存"。Enter the new site address, and then select Save.

备注

您不能更改中心网站的地址、锁定的或保留的网站,也不能更改具有 BCS 连接的网站的地址。You can't change the address of hub sites, sites that are locked or on hold, or of sites that have BCS connections.
当您更改网站地址时,我们将创建上一个地址的重定向。When you change a site address, we create a redirect at the previous address. 如果要重用以前的地址,则需要删除重定向。If you want to reuse the previous address, you need to delete the redirect. 了解方法Learn how

使用 Microsoft PowerShell 更改网站地址Change site addresses by using Microsoft PowerShell

  1. 下载最新的SharePoint在线管理壳Download the latest SharePoint Online Management Shell.

    备注

    如果你已安装早期版本的SharePoint Online Management Shell,请进入添加或删除程序并卸载 "SharePoint Online Management Shell"。If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."
    在 "下载中心" 页面上,选择你的语言,然后单击 "下载" 按钮。On the Download Center page, select your language and then click the Download button. 系统会要求你下载 x64 和 x86 .msi 文件之间做出选择。You'll be asked to choose between downloading a x64 and x86 .msi file. 如果你运行的是64位版本的Windows,请下载x64文件,如果你运行的是32位版本,请下载x86文件。Download the x64 file if you're running the 64-bit version of Windows or the x86 file if you're running the 32-bit version. 如果你不知道,请参阅我运行的是哪个版本的 Windows 操作系统?If you don't know, see Which version of Windows operating system am I running?. 下载文件后,运行该文件并按照安装向导中的步骤进行操作。After the file downloads, run it and follow the steps in the Setup Wizard.

  2. 在Microsoft 365中,以全局管理员或SharePoint管理员连接到SharePoint。Connect to SharePoint as a global admin or SharePoint admin in Microsoft 365. 若要了解具体操作步骤,请参阅 SharePoint 在线管理壳入门To learn how, see Getting started with SharePoint Online Management Shell.

  3. 运行以下命令以验证网站地址是否可以更改:Run the following command to verify that the site address can be changed:

    Start-SPOSiteRename -Identity <SiteURL> -NewSiteUrl <NewSiteURl> -ValidationOnly
    
  4. 运行以下命令以更改网站地址:Run the following command to change the site address:

    Start-SPOSiteRename -Identity <SiteURL> -NewSiteUrl <NewSiteURl>
    

有关此 cmdlet 的详细信息,请参阅 SPOSiteRenameFor more info about this cmdlet, see Start-SPOSiteRename

更改网站地址的影响Effects of changing a site address

在更改过程中,将网站设置为只读,并创建一个重定向。While the change is in progress, the site is set to read-only, and a redirect is created. 更改完成后,如果用户已将网站保存为收藏,或者他们选择了指向网站的链接,则会将用户重定向到新的 URL。After the change is complete, users are redirected to the new URL if they've saved the site as a favorite, or if they select a link to the site.

应用Apps
如果您的组织中的应用程序引用网站的 URL,则您可能需要在更改网站地址时重新发布应用程序。If apps in your organization refer to the site's URL, you might need to republish the apps when you change the site's address.

在 PowerApps 中创建的自定义窗体Custom Forms Created in PowerApps
您需要在网站地址更改后重新创建自定义窗体。You need to recreate the Custom Form after the site address change.

中心网站Hub sites
如果网站与中心关联,则需要在更改网站地址后 reassociated。If the site is associated with a hub, it will need to be reassociated after the site address is changed.

InfoPath 表单InfoPath forms
更改网站地址后,引用 Url 的 InfoPath 表单可能不起作用。InfoPath forms that refer to URLs might not work after the site address is changed.

列表视图 Web 部件List View web part
如果将列表视图 web 部件添加到页面中,并限定为该列表中的特定文件夹,则在更改网站 URL 后,web 部件可能会显示一个错误。If a List View web part is added to a page and scoped to a specific folder in that list, the web part might display an error after the site URL is changed. 若要解决此问题,请编辑 web 部件并重置文件夹路径或从页面中删除 web 部件,然后重新添加它。To fix this issue, either edit the web part and reset the folder path or remove the web part from the page and then add it again.

OneNoteOneNote
如果用户在网站地址更改期间打开了笔记本,他们将看到 "笔记本同步" 错误。If users have a notebook open during the site address change, they'll see a notebook sync error. 更改地址后,以下 OneNote 应用将自动检测并将笔记本无缝同步到新网站 URL:After the address is changed, the following OneNote apps will automatically detect and seamlessly sync notebooks to the new site URL:

  • OneNote 桌面应用程序–版本16.0.8326.2096 及更高版本OneNote desktop app – Version 16.0.8326.2096 and later
  • 适用于 Windows 10 的 OneNote –版本16.0.8431.1006 和更高版本OneNote for Windows 10 – Version 16.0.8431.1006 and later
  • OneNote 移动应用程序–版本16.0.8431.1011 及更高版本OneNote mobile app – Version 16.0.8431.1011 and later

用户无需再次登录或执行其他任何操作。Users don't need to sign in again or take any other action.

权限Permissions
有权访问网站的人员可以在网站地址更改期间和之后访问网站。People who have permission to access the site can access the site during and after the site address change.

Power AppsPower Apps
您需要将应用程序或应用程序重新连接到数据源。You need to reconnect the app or apps to your data source. 先删除现有 SharePoint 连接,然后再重新连接到您的数据之前可能已有的任何列表。Start by deleting the existing SharePoint connections to any lists you may have before you reconnect to your data. 完成此操作后,请将您的应用程序重新连接到所使用的 SharePoint 列表。Once you've done that, reconnect your app to the SharePoint lists you were using. 大多数字段应自动更新。Most fields should update automatically. 某些类型似乎在更新时遇到问题,通过简单地删除域然后撤消删除,可以修复这些类型。Certain types seem to have trouble updating and can be fixed by simply deleting the field and then undoing the delete.

Power AutomatePower Automate
在网站地址更改后,将需要重新创建流。Flows will need to be recreated after the site address change.

Office 应用中的最近列表Recent lists inside Office apps
Word、Excel 和 PowerPoint 桌面应用程序和 web 应用程序将在更改后显示新的 URL。The Word, Excel, and PowerPoint desktop apps and apps for the web will show the new URL after the change.

回收站 回收站中的文件将根据常规删除时间范围可还原。Recycle bin Files in the recycle bin will be restorable as per the usual deletion timeframe.

适用于 Android 和 iOS 的 SharePoint 移动应用SharePoint mobile apps for Android and iOS
SharePoint 移动应用程序将检测网站的新 URL。The SharePoint mobile apps will detect the site's new URL. 请确保用户已将其应用更新到最新版本。Make sure that users have updated their apps to the latest version.

SharePoint 工作流2013SharePoint workflow 2013
更改网站地址后,将需要重新发布 SharePoint 工作流2013。SharePoint workflow 2013 will need to be re-published after the site address is changed.

共享链接Sharing links
在网站地址更改后,共享链接将自动重定向到新的 URL。After the site address is changed, sharing links will automatically redirect to the new URL.

网站自定义项和嵌入代码Site customizations and embedded code
引用 Url 的网站自定义项和嵌入代码可能需要在网站地址更改后修复。Site customizations and embedded code that refer to URLs might need to be fixed after the site address change. 更改网站地址将保留在 SharePoint 中存储的数据,但不会更改自定义解决方案中的 URL 依赖项。Changing the site address will preserve data stored in SharePoint but won't change URL dependencies in custom solutions.

同步位置Synced locations
在更改网站地址后,OneDrive 同步应用程序将自动检测并无缝地将同步传输到新的网站 URL。The OneDrive sync app will automatically detect and seamlessly transfer syncing to the new site URL after the site address has been changed. 用户无需再次登录或执行其他任何操作。Users don't need to sign in again or take any other action. (的版本17.3.6943.0625 或更高版本。 ) 如果用户在更改网站地址时更新了文件,则会看到一条消息,表明在更改过程中文件上载处于挂起状态。(Version 17.3.6943.0625 or later of the sync app required.) If a user updates a file while the site address is being changed, they'll see a message that file uploads are pending during the change.

**适用于 Microsoft 365 组连接的网站的团队 () **Teams (for Microsoft 365 group-connected sites)
网站地址更改完成后,用户将能够在团队应用程序中访问其 SharePoint 文件,但有以下限制。When the site address change is complete, users will be able to access their SharePoint files in the Teams app, with the following limitations.

功能Functionality 限制Limitation
通道中的 "文件" 选项卡Files tab in channels 在更改地址后,将需要刷新一次 "文件" 选项卡。The Files tab will need to be refreshed once after the address change.
查看团队中的文件Viewing files in Teams 在更改地址之前频道中共享的文件可以在频道的 "文件" 选项卡上的 "团队" 应用中查看。此外,还可以通过频道的 "文件" 选项卡或对话在 Office 相关网站中查看这些用户。Files shared in channels before the address was changed can be viewed in the Teams app on the channel's Files tab. They can also be viewed in Office apps for the web from the channel's Files tab or the conversation. 若要查看桌面应用程序中的 Word、Excel 和 PowerPoint 文件,请执行以下操作:To view Word, Excel, and PowerPoint files in the desktop apps:
从频道的 "文件" 选项卡中选择 "从桌面打开" 选项。Select the “Open in Desktop” option from the channel's Files tab.
在 Office 相关 web 应用程序中打开文件,然后选择 "在桌面中打开"。Open the file in the Office app for the web, and then select “Open in Desktop”.
将文件上传到频道Uploading files to channels 在用户访问网站中任何频道的 "文件" 选项卡后,将文件从计算机或 OneDrive 上传到频道对话将正常工作。Uploading files from a computer or OneDrive to a channel conversation will work after a user has visited the Files tab for any channel in the site.
文件搜索File search 团队中的搜索仅显示其地址尚未更改的网站中的文件。Search in Teams will show files only from sites whose addresses have not been changed.
文件应用程序– Microsoft 团队页面File app – Microsoft Teams page 当用户访问了网站中任何频道的 "文件" 选项卡后,团队文件应用中的 "Microsoft 团队" 页面将正常工作。The Microsoft Teams page in the Teams File app will work after a user has visited the Files tab for any channel in the site.
工作组移动应用程序Teams mobile app 打开并下载将继续有效。Open and download will continue to work. 若要编辑网站中的 Word、Excel 或 PowerPoint 文件,请使用适用于 web 的 Office 应用程序或桌面应用程序。To edit a Word, Excel, or PowerPoint file in the site, use the Office app for the web or the desktop app. 在网站地址更改后共享的文件可在 Office 移动应用中进行编辑。Files shared after the site address was changed can be edited in the Office mobile apps.