SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a site collection so that url looks like instead of How do I do that?

share|improve this question
up vote 8 down vote accepted

What you're looking for is the host named site collection, which enables you to assign a unique DNS name to site collections. Or alternatively create an AAM for existing Site collection to achieve it. For example, you can address them as or

The sample PowerShell code creates a new web application listing on port 80, and two host named site collections that use the Publishing Portal site template.

  1. Create a web application to host your host-named site collections

    $w = New-SPWebApplication -DatabaseName "WSS_Content" -ApplicationPool "SharePoint - Content App Pool" -Name "HostNameTest" -Port 80

  2. Perform an IIS reset

    IISRESET /noforce on each server before using the new web application

  3. Create a root site collection

    This is required for Search crawling content. For more information, see:

    $webAppUrl = "web application url" #ex: http:// sharepointserver

    New-SPSite $webAppUrl -OwnerAlias "SP\someusername" $w -Name "RootSC"

  4. Create your site collections

    $w = Get-SPWebApplication "HostNameTest"

    New-SPSite -OwnerAlias "SP\someusername" -HostHeaderWebApplication $w -Name "HostA" -Template "BLANKINTERNETCONTAINER#0"

    New-SPSite -OwnerAlias "SP\someusername" -HostHeaderWebApplication $w -Name "HostB" -Template "BLANKINTERNETCONTAINER#0"

So, you will have a web application with two two host-named site collections.

If SSL is a requirement, you can also create the web application and the host-named site collections using https (ex: port 443). But you will need to buy a wildcard certificate or a SAN certificate for * Also note that SSL is a requirement for certain features of SharePoint 2013.

To find more information:

share|improve this answer
Assaalamualaikum. Can you provide details on how to do this using AAM? – Mitch Veeno Jun 30 '12 at 20:51
WSalam, before you plan to go ahead, you need to make sure that AAM is configured correctly. The reason is when SharePoint receives a request it will only use AAM to perform that URL resolution. So while it is necessary to make sure your hosts files, DNS, and IIS bindings are properly configured so that a web request can reach the SharePoint server, it is also necessary to configure the URLs in AAM to match. See the link to try it yourself:… – Falak Mahmood Jun 30 '12 at 22:21

You need to create a new web application and specify this as the URL, yes you could use an existing site collection an extend it using AAM but if you are starting from scratch a new web app and site collection is best.



share|improve this answer

Specify the host header what you want it to look like while creating new web application. or you can always use Alternate access mapping to look like

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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