Change a SharePoint site collection top-level site URL

1 minute

Changing a SharePoint site collection name is easy enough (Site Settings –> “Title, description, and logo”), but changing the URL for a top-level site is a bit more involved than just changing a subsite URL. Note that this post applies to on-premise/server environments only.

  1. Connect to/log in to your SharePoint server
  2. Open SharePoint 2013/2016 Management Shell in administrator mode (right-click, “Run as administrator”
    Capture.PNG
  3. Once the module loads, enter the following three cmdlets (I recommend typing and entering them one line at a time, not copying and pasting):

$site = Get-SPSite https://sharepoint.mycompany.com/sites/OldName
$site.Rename("https://sharepoint.mycompany.com/sites/NewName")
iisreset

After the IISReset cmdlet is run, it may still take a small while for the new site’s URL to work as expected.

Notes

  • If you’re receiving “Get-SPSite : Cannot find an SPSite object with Id or Url: http://…” it could be you’re attempting to change the URL for a subsite, not a site collection top-level site.
    chrome_2018-11-01_08-38-39.png
  • This renaming method will only work for managed paths (central admin –> manage web applications –> select a web app and “managed paths”) that are of type “wildcard inclusion”. Typically out of the box this only includes “sites”
    wildcard inclusion.png
  • This article first published by Waqas Sarwar does a good job of explaining the pros and cons of alternative methods (such as Copy-SPSite and Backup & Restore), as well as the limitations: SharePoint 2016: Rename Site Collection URL Best Practice

 


Discover more from Nate Chamberlain

Subscribe to get the latest posts sent to your email.

3 responses to “Change a SharePoint site collection top-level site URL”

  1. Aleksandrs Avatar
    Aleksandrs

    Thank you very much for sharing!

  2. […] Change a SharePoint site collection top-level site URL […]

  3. […] Note: If you’re trying to change the URL for a top-level site (site collection level), you’ll need to change the URL as an administrator using PowerShell. […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nate Chamberlain

Subscribe now to keep reading and get access to the full archive.

Continue reading