Уреди

Делите путем


Manage site redirects

As part of changing a SharePoint site address, moving a site to a different geo location, or swapping a site, we automatically create redirects to ensure that links pointing to the prior URL continue to work. These redirects are sites that use a special site template at the prior site URL.

For example, if you changed a site address from https://contoso.sharepoint.com/sites/OldSiteName to https://contoso.sharepoint.com/sites/NewSiteName or moved a site from https://contoso.sharepoint.com/sites/SiteName to https://contosoEUR.sharepoint.com/sites/SiteName, we'll place a redirect (Template type REDIRECTSITE#0) at the old URL, which contains special headers and logic to redirect your browser requests to the new site.

In some cases, you might want to free up the old URL to use it for a new site. To do this, you need to delete the redirect.

Note

After you delete a redirect, any request to that URL won't get redirected. This means that any bookmarks, links, or Shared With Me references will not be routed to the new URL.

To remove a redirect

  1. Download the latest SharePoint Online Management Shell.

    Note

    If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."

  2. Connect to SharePoint as a Global Administrator or SharePoint Administrator in Microsoft 365. To learn how, see Getting started with SharePoint Online Management Shell.

  3. Run the following command:

    Remove-SPOSite -Identity https://contoso.sharepoint.com/sites/OldSiteName
    

    Note

    If you get an error message "The operation is not supported for the site," make sure a retention policy isn't applied to the old or new URL for the site. You might need to remove the retention policy to delete the redirect.

  4. When prompted, confirm that you want to delete the redirect.

To confirm that the redirect has been deleted, browse to the URL. It should return a 404 error. You can also run Get-SPOSite -Identity https://contoso.sharepoint.com/sites/OldSiteName. It will return that we cannot get the site.

Note

You might need to clear your browser history and cache before browsing to the URL. Otherwise, it may take longer for the redirect site deletion to reflect, depending on individual browser settings.

To get a list of all redirect sites

Run the following command.

Get-SPOSite -Template REDIRECTSITE#0