Dot Net Mafia

Group site for developer blogs dealing with (usually) Ionic, .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog



Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for Ionic, SharePoint, and Office 365.

Creating path-based site collections in conjunction with your host-named site collections

In SharePoint 2013, host-named site collections (HNSC) are all the rage.  SharePoint Online has been using them heavily for some time now and in general, they are the preferred method for creating site collections now with SharePoint 2013.  If you aren’t familiar with what I mean by host-named site collections, let me give you an example.  Host-named site collections give you the ability to provide completely different URLs for a site collection regardless of the web application URL hosting it.  For example, you might have a web application URL named and under it you have a collaboration site with a URL of and an Intranet site named  This allows you to host multiple types of SharePoint sites together on a single web application which ultimately reduces the amount of resources your server farm needs for application pools.

Host-named site collections are great, but what if we want to append a path-based site collection onto our HNSC?  The TechNet article does a good job explaining HNSC but when I read it, it wasn’t clear to me if you could combine the two. Now, this is interesting but what if your HR department wants their own site collection under  You could always give them an HNSC as well such as  However, if you don’t want that and you really want the URL to be located under your other URL such as, this can be done with some simple PowerShell commands.  If you have worked with HNSC before, you know PowerShell is our only option if we want to use them as there is not any place in Central Administration to set them up.

Just like any site collection, you have to create a managed path for the URL you want.  We do this using New-SPManagedPath.  We can add explicit or wildcard inclusions just like you can for path-based site collections.  Wildcard is the default, if you want explicit, include the –explicit parameter.  We also need to add the –HostHeader parameter to indicate this is used with host-named site collections.  Here’s an example, where I created the HR explicit path from our example above.

New-SPManagedPath "MyPath" -HostHeader -Explicit


This technically makes this managed path available on any host-named site collection.  If you want to see what managed paths have been created for host-named site collections, use Get-SPManagedPath with the –HostHeader command.

Get-SPManagedPath -HostHeader


Now, we need to create the site collection using New-SPSite.  It takes a few parameters but the important ones for this scenario is the URL we want for the new site collection and then –HostHeaderWebApplication to specify which web application hosts the new site collection.

New-SPSite -HostHeaderWebApplication http://webapplicationurl -Name "Site Name" -OwnerAlias domain\user -Template STS#0


When the command is done, you will have a new site collection at the URL you specified.  Give it a try for yourself.



Robert said:

Hi and thanks for this useful post. Is it possible to create the Site Collection directly on the Managed Path?

September 4, 2013 2:44 AM

Barry said:

Is there a way to do this in SP2010?

September 4, 2013 10:45 AM

Creating path-based site collections in conjunc... said:

Pingback from  Creating path-based site collections in conjunc...

September 4, 2013 12:49 PM

CoreyRoth said:

@Robert not sure what you are meaning exaclty.  Can you provide more details?  Thanks!

September 4, 2013 1:44 PM

CoreyRoth said:

@Barry I'll need to look into that...

September 4, 2013 1:45 PM

Robert said:

Hi again, I meant you created the managed path "MyPath" like this New-SPManagedPath "MyPath" -HostHeader -Explicit

and then directly you created a new Site Collection on same path "MyPath" like this.

New-SPSite -HostHeaderWebApplication http://webapplicationurl -Name "Site Name" -OwnerAlias domain\user -Template STS#0

September 6, 2013 2:02 AM

Morgan Roach said:

I appreciate this helpful post!

September 17, 2013 1:19 PM

The Microsoft MVP Award Program Blog said:

1. Using Microsoft Dynamics CRM 2011 and Internet Explorer 10 By Dynamics CRM MVP Chris Cognetta –

September 20, 2013 4:30 PM

Friday Five – September 20, 2013 | MSDN Blogs said:

Pingback from  Friday Five  – September 20, 2013 | MSDN Blogs

September 21, 2013 6:59 AM

Blog de Juan Carlos González en Geeks.MS said:

Como cada mes, aquí os dejo el recopilatorio de enlaces interesantes sobre SharePoint 2013 y Office 365

October 1, 2013 8:23 AM

SharePoint 2013: Recopilatorio de enlaces interesantes (XV)! | Pasi??n por la tecnolog??a... said:

Pingback from  SharePoint 2013: Recopilatorio de enlaces interesantes (XV)! | Pasi??n por la tecnolog??a...

October 1, 2013 8:24 AM

mike said:

You say "SharePoint Online has been using [HNSC] heavily for some time now"

Everything I've read from the MS documentation says exactly the opposite. According to that, HNSC are only possible for on-premise installations of SharePoint 2013 and are NOT an option for SharePoint Online (nor have they ever been). If that isn't the case I would love to find out how to do is as I would prefer using HNSC over paths.

December 5, 2014 12:16 PM

CoreyRoth said:

@Mike to clarify that, SPO uses HNSC behind the scenes for the multi-tenant configuration.  Your public site is an example of a site that uses HNSC.  Unfortunately though as you mentioned, you can't create your own HNSC and you are locked into your tenant name for the prefix.

December 5, 2014 1:00 PM

Dennis said:

It looks like you assign a host to your host web.  Doesn't this mean that you have to add the host from each HNSC to the web app as well?

I'm just wondering the pros/cons of having no host assigned to the web app.  Basically just using the server name.

October 8, 2015 5:15 PM

CoreyRoth said:

@Dennis SharePoint will usually take care of adding the host header to the web application.  Sometime it doesn't though so if you are experiencing issues.  You want to check that.  HNSC just gives you more flexibility in what you name things.

October 9, 2015 8:58 AM

CoreyRoth said:

@Mike I think the parameter for your -HostHeaderWebApplication is supposed to be if I remember right.

October 9, 2015 9:01 AM

Rishi Pandit said:

But you must know, Sharepoint (2007, 2010, 2013 & even 2016) is limited only to 20 managed path per site collection. You will get stuck after provisioning 20 managed path site collection. If your requirement is not so vast, you can surely go with this great post. Thanks CoreyRoth for this post.

October 28, 2016 8:09 AM

Leave a Comment


About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2018 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems