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:

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 http://contoso.old




Comments (7)
  1. Paul Beck says:

    $site = Get-SPSite -URL http://contoso.old

    Should read:

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

  2. Thanks for catching that Paul. Updated the post.

  3. David Arango says:

    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!


  4. Anders Rask says:

    Or just use

    Get-SpSite http://contoso.old | Set-SPSite -Url

  5. Rich says:

    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?

  6. 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.

    1. Dan R says:

      Thanks – you are still helping our us SharePoint admins

Comments are closed.

Skip to main content