I am attempting to create a Site Collection that appears as a managed path. Here is the scenario:

I have a company that is in many regions and I have a toplevel portal for them - finance. the HNSC is finance.companyname.com. I would like to create another HNSC to break the company finance down to geographic locations, and then regions - finance.companyname.com/ca and further to finance.companyname.com/ca/cityname.

I have created the following powershell script to create a site collection with it's own content database as follows (the /ca was added for this particular requirement):

New-SPSite 'http://finance.companyname.com/ca' -OwnerAlias 'domain\FarmAccount' -HostHeaderWebApplication 'http://companyportal.company.com' -Name 'Company Finance Canada' -Description 'Company Canadian Finance Departments Portal Site' -ContentDatabase (Get-SPContentDatabase SiteCollection_ContentDB) -language 1033 -Template 'STS#0'

The result is that I receive the error "site collection could not be created as the provided hostheader managed path does not exist. Change the url to use an existing hostheader managed path or create the missing hostheader managed path prior to calling this command."

The reason for all of this is to have each site collection regionally identified and using its own content database. I am trying to stay in the arena of HNSC's and prefer to not have to use managed paths, but need the effect of such, if possible.

This is what I need to achieve:

finance.companyname.com - portal with separate contentDB (done)

finance.companyname.com/ca - Canadian portal with own contentDB

finance.companyname.com/ca/cityname - regional site collection with own contentDB

Any help is greatly appreciated.

1 Answer 1


Managed paths for host-named site collections behave differently from managed paths for path-based site collections. Managed paths for host-named site collections are available to all host-named site collections within the farm regardless of the web application that the host-named site collection is in. In contrast, managed paths for path-based site collections only apply to sites within the same web application. Managed paths for path-based site collections do not apply to path-based site collections in other web applications. Managed paths for one type of site collection do not apply to the other type of site collection.

To create a managed path, you must first create a site collection with the desired base URL. For example, to create http://finance.companyname.com/ca you must first create the site collection for http://finance.companyname.com. To create a managed path for use with host-named site collections, Use the following command.

New-SPManagedPath 'ca' -HostHeader

You can also use the –explicit parameter to create explicit managed paths.

after that Run your command and it will created sucessfully.


  • Thanks for the answer. I have read through the article and also noticed there is a limit of using only 20 managed paths, and that fact alone may not work in the long run, so i may be better served using URL mappings to friendly URL names and not rely on any managed paths at all.
    – SGTech
    May 27, 2015 at 21:54
  • Yea, that is limit....so you have to plan accordingly
    – Waqas Sarwar MVP
    May 27, 2015 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.