This article will discuss SharePoint site collections in the context of possible initial url addresses.
And the most interesting, describes how to create a collection site on a specific url on a subdomain other than the main application.
So, everyone who is interested in the administration of SharePoint, and those who do not know the course 70-331 far and wide, welcome under the cat.
Strongly I will not get into the theory, because it is obvious to those professionals who may be interested in the final thesis of the article. We will talk about url addresses that can be hosted by the SharePoint collection site.
Without a minimum of theory, it would also be wrong.
If you look at the logical architecture of SharePoint sites, we will see the following picture:

')
At the head of the table are IIS and web applications, as part of web applications, the site of the collection is located, and in turn, a collection of sites.
From the point of view of addressing, the web application determines the Host Header and the port, which, by the way, can easily be redefined by alternative access (AAM) or web application extension.
As an example, let's have the following web application:
sharepoint2013.mysite.org
Collection sites are containers for sites that already in turn contain information displayed to the user.
At the same time, the site collection always contains the root site.
Sites may have a hierarchy of subsites.
Addresses of subsites are formed as follows:
/subsite1/subsite11/.../subsiteNM/
Collection sites can be placed on managed paths that define the starting address.
Managed paths are of two types:
- Explicit (Explicit)
- In the case of explicit paths, the site collection will be located in the root of the managed path; on this path, it is logical to assume that only one site collection can exist.
- Let's continue the example, let's say we have created a managed path “spdemo” with type Explicit.
- The link to the created collection site will be as follows:
sharepoint2013.mysite.org spdemo /
- Wildcard (Wildcard)
- Substitutions were created so that they could have a lot of site collections, and for each site a collection will be added a “folder” in the path of the address.
- By default, the managed path “sites” is created.
- When creating a site for the spdemo collection, the link will be as follows:
sharepoint2013.mysite.org sites / spdemo /
Creating a site of collections on controlled paths is not a tricky business, it is accessible from the visual interface, and, in general, a rather trivial thing. But we already got to the "salt" of the article.
Let's imagine the situation that we need:
- our farm to bring to end users using subdomains, here it is a functional requirement: CRM should be at crm.mysite.org , project management - epm.mysite.org , workflow on ecm.mysite.org and so on and so on, and nothing else,
- i.e., all addresses must be on port 80,
- The number of subdomains for different functional cases is not limited.
It seems like the idea comes to create different web applications for different subdomains, but you should not do so, if the creation of separate web applications is not due to security policy or any other valid reasons.
By the way, the question is: can there be several web applications on one port? Answer: yes, of course they can, if they are with different Host Headers.
So what to do, you ask, if you do not create separate web applications? How to be?
And for the sake of this answer the whole post. Collection sites can also be on a subdomain other than the Host Header of the web application.
You can create such site collections only through PowerShell.
And here he is:
Add-PSSnapin Microsoft.SharePoint.PowerShell-ErrorAction SilentlyContinue; New-SPSite "http://spdemo.cibpoint.ru" ` -HostHeaderWebApplication "http://sharepoint2013.cibpoint.ru" ` -Name "SPDemo" ` -OwnerAlias "CIBSPAdmin" ` -Template "STS#0"; New-WebBinding -Name "http://sharepoint2013.cibpoint.ru" ` -IPAddress "*" ` -Port 80 ` -HostHeader "spdemo.cibpoint.ru";
Add-PSSnapin - adding snappin to the SharePoint object model, a good tone to make it present.
New-SPSite is a collection site creation cmdlet.
- In the transmitted identifier, you must specify a link in the subdomain and it will work.
- In the parameter HostHeaderWebApplication we specify our web application.
- Name - the name of the collection site.
- OwnerAlias ​​- the owner of the collection site, the second can be omitted.
- Template - collection site template id. “STS # 0” - TeamSite ID. You can skip the parameter, then when you first navigate to the collection site you can select the desired template in the visual interface.
New-WebBinding is one of the components of the miracle. Directly to SharePoint has no relation. This cmdlet sets the IIS setting, namely, it registers the connection with the desired Host Header.
The last component of the “miracle” is to add an entry to the DNS.
As a result, in one web application, on one port, on different subdomains, we have a SharePoint collection site running and working.