Change Host Named Site Collection Url

Change Host Named Site Collection Url

  • Comments 3

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

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

HTH

 

Leave a Comment
  • Please add 3 and 6 and type the answer here:
  • Post
  • $site = Get-SPSite -URL http://contoso.old

    Should read:

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

  • Thanks for catching that Paul. Updated the post.

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

Page 1 of 1 (3 items)