Change Host Named Site Collection Url

Change Host Named Site Collection Url

[Srinivas Varukala](https://social.msdn.microsoft.com/profile/Srinivas Varukala) 5/6/2014 3:29:00 PM


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

About the author

I work with customers helping them achieve more using Microsoft Technologies. I am in my 9th year with Microsoft as of March 2020. I get to work with really smart people (both at Microsoft and Customers). Helping customers, removing any blockers, rapid prototyping is my core work.