SPSiteUrl’s in SharePoint 2013

,

SharePoint 2013 Publishing Site
One of the new capabilities introduced with SharePoint 2013 are SPSiteUrl’s. So what is it exactly, what can you do with it and why is it so cool?

Host Named Site Collections – a glance behind

Back in 2006 SharePoint 2007 introduced the concept of Host Named Site Collections. Normally, when building sites we could specify a host name on the Web Application. Should we need to add other hosts we could extend the Web Application to one of four zones and with that add other host names. Site Collections would be then created underneath the Web Application either on an explicit or a wildcard path. There is a limitation with regard to how many Web Applications you can have on a farm, so from the scalability perspective working with Web Applications is not a great story. So in order to extend the scale of websites with their own hosts, SharePoint 2007 introduced the concept of Host Named Site Collections where you could specify a host name, other than the one of the Web Application, on the Site Collection-level.

Although Host Named Site Collections in SharePoint 2007 and SharePoint 2010 improved the scalability, they had one serious limitation: you could define only one host name which was always associated with the Default Zone. Should the underlying Web Application be extended and using other Zones with their own authentication settings or policies, we weren’t able to make use of any of that in Host Named Site Collections.

SharePoint 2013 SPSiteUrl’s

One of the new capabilities introduced with SharePoint 2013 are the SPSiteUrl’s. SharePoint 2013 allows us to define multiple hosts on every Host Named Site Collection. When defining a URL it’s always mapped to a Zone which are the same as for a Web Applications. And although there are still only 5 Zones, you can define multiple URL’s for every Zone. The great thing is that SharePoint 2013 is quite clever in how it deals with Zones and SPSiteUrl’s. If you associate an SPSiteUrl with a Zone which hasn’t been defined on the Web Application, it will be mapped to the Default Zone’s settings. If you however map it to a Zone that has been defined, all settings of that Zone will apply to that particular URL when requesting the Site Collection.

Managing SPSiteUrl’s is straight-forward and can be done using PowerShell. Three new cmdlets have been introduced for us to view, add/edit and remove SPSiteUrl’s, respectively Get-SPSiteUrl, Set-SPSiteUrl and Remove-SPSiteUrl. The great thing is that the way SPSiteUrl’s have been implemented, you can modify any of the URL’s at all times including the one you used for creating the Host Named Site Collection.

Why should you care?

The introduction of SPSiteUrl’s is great news for a few reasons. First of all we can now leverage the Zone settings of the Web Application in Host Named Site Collections. One scenario that you could think of here is having two Zones on a public-facing website: one mapped to an HTTPS URL and one to HTTP. You could map the HTTP Zone to a URL that doesn’t allow authentication and should users want to login to the site they would have to use the HTTPS URL.

Another usage scenario that you could think of is adding additional host names on a public-facing website to increase the number of concurrent downloads. By default a web browsers makes up to 5 requests in parallel to the same host. By adding additional host names to your site, such as www2.mavention.nl, you can serve a number of files using that URL having your website load faster.

Summary

Back in SharePoint 2007 and 2010 we could use Host Named Site Collections to work around the scalability limitations. The downside was the inability to benefit of the Zones configuration of the Web Application. Using the SPSiteUrl’s capability introduced with SharePoint 2013 we can now associate multiple host headers with a single Site Collection and those host headers can be mapped to Zones defined on the Web Application.

6 Responses to “SPSiteUrl’s in SharePoint 2013”

  1. Ernesto Says:

    Is there a way to do this SharePoint 2010?

  2. Waldek Mastykarz Says:

    Unfortunately not, SPSiteUrls are a new capability in SharePoint 2013.

  3. Ilkka Lehto Says:

    I was unable to add additional URLs for my host named site collection's Default Zone. After looking around, I hit this: http://support.microsoft.com/kb/2826457 So, does this mean that I can't add multiple URLs for a zone anymore? Was it possible prior to RTM?

  4. Waldek Mastykarz Says:

    You are right: you cannot associate multiple SPSiteUrls with the same zone. Instead you should associate SPSiteUrls with different zones. If those zones are not configured at the Web Application level, they will get settings from the Default Zone so there is no problem there.

  5. Ilkka Lehto Says:

    Hi Waldek and thank you for answering!

    Would you happen to know how to change the url associated to a default zone of a HNSC? I have a HNSC with url http://foo in the defaul zone. When I try to change it with this commandlet:

    Set-SPSiteUrL -Identity http://foo -Url http://bar -Zone Default

    I get the following error.

    Set-SPSiteURL : Could not set URL http://bar/ for zone Default because a URL is already set for the zone. To set a URL for this zone, first remove the existing URL http://foo/.

    And when I try to remove that url – as implied in the error message above – with this commandlet:

    Remove-SPSiteUrl -Url http://foo

    I get the following error:

    Remove-SPSiteURL : Cannot remove the primary url for this site collection. Perform a site rename instead.

    But I have no idea how to perform a site rename.

  6. Waldek Mastykarz Says:

    This one should help you: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.rename.aspx

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS
Copyright © 2007 - 2013 Waldek Mastykarz

Creative Commons License