Change Host Named Site Collection Url

Previously (i.e. until SP2010) zones was applicable only at the Web App level. You can have up to 5 zones and thus five different urls.

With SharePoint 2013 this concept has been extended to the Site Collection level - but only to the Host Named Site Collections (HNSC). You can have up to 5 different URLs each associated with a zone for a single host named site collection. You can achieve this using the Set-SPSiteUrl PowerShell cmdlet.

Before RTM, SharePoint 2013 had the ability to have multiple URL's for the same zone. So you can have any number of URLs not just five. But this feature has been discontinued/deprecated since RTM. Here is a KB article endorsing this: https://support.microsoft.com/kb/2826457.

There are still some blog posts (link, link) which mentions that this is still possible - but its not.

OK. That's enough background I guess. Coming to the title of this post:

Since you cannot have multiple URLs for a single zone. Lets say you have a HNSC that was either built new or restored from an existing one. And now you want to change the URL for this HNSC and for that zone in particular. If the above feature was available you could easily add your required URL using the Set-SPSiteUrl cmdlet. But since the above feature doesn't exist anymore there is an easier way to accomplish this. You can use the SPSite.Rename method to change the URL of a HNSC to a new URL. Here is the PowerShell script:

$site = Get-SPSite -Identity https://contoso.old

$site.Rename("https://contoso.new")

HTH

Comments

  • Anonymous
    September 04, 2014
    $site = Get-SPSite -URL http://contoso.old Should read: $site = Get-SPSite -Identity http://contoso.old

  • Anonymous
    September 05, 2014
    Thanks for catching that Paul. Updated the post.

  • Anonymous
    September 05, 2014
    Good evening, We just tried this command, and in fact it worked. But is there a way of replacing the OLDURL associations? Thanks a lot! David.

  • Anonymous
    January 13, 2015
    Or just use Get-SpSite http://contoso.old | Set-SPSite -Url http://contoso.net

  • Anonymous
    March 19, 2015
    I used this new command on my 2013 HNSC which is using SSL. It's now showing a certificate error. Is there a command I need to run to fix that?

  • Anonymous
    March 19, 2015
    Check what is the URL that your certificate is associated with. The error you are seeing might be because your certificate is no more valid for the new URL that you changed to.

    • Anonymous
      January 19, 2018
      Thanks - you are still helping our us SharePoint admins