I'm beginner in SharePoint. I'm working in SharePoint 2013.

I'm confused about site collections.

When we are getting site collection, we can do it like this e.g.:

SPSite site = new SPSite("localhost:32000");

Doesn't this mean that we get more Site Collections than one? If I understand, localhost:32000 in this case is url of web application. And I know web application can have more site collections.

And when we want to create web site to web collection, shouldn't we specify for which site collection are we making web site?

So am I wrong, can anyone explain please this?

2 Answers 2


localhost:32000 is the url of the web application as well as url of root level site collection. In each webapplication, we have one root site collection which url is same as web application.

if you want to create the site collection for next level, then you have to provide the path something like this "localhost:32000/sites/abc"

read this microfsoft article: https://docs.microsoft.com/en-us/sharepoint/sites/sites-and-site-collections-overview


You can also create HNSC site collection in SharePoint as well. This can be done only via Powershell and not from the Central administration site. Check here for more details https://docs.microsoft.com/en-us/sharepoint/administration/host-named-site-collection-architecture-and-deployment

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.