Creating hostname site collections

In SharePoint 2013 by rhodzyLeave a Comment

A hostname site collection is a nice looking URL rather than your boring silly long ones that are created as standard within your SharePoint farm.

Example:

Standard: http://sharepoint/sites/something
Hostname: http://something

To do this you will need to do the following:

  • Get the DNS record created for the hostname site collection
  • Point the DNS record to your load balancer or SharePoint 2013 server
  • Have access to the server as it has to be done via PowerShell

Once the above is complete you simply need to do the following within PowerShell (one more thing worth checking is make sure it’s going to create the site in the correct database, many times I’ve forgotten to stop one and I’ve ended up with the site in the wrong database)

New-SPSite “http://something” -HostHeaderWebApplication “http://yourwebapp/” -Name ‘Fancy site name‘ -Description ‘Optional‘ -OwnerAlias ‘domain\user‘ -language 1033 -Template ‘STS#0

The parts above in bold require you to change them for your needs, the template code in use above is a team site which usually does the trick for most peoples needs.

You will also notice that the default user groups aren’t created. You can do this by following this guide

Hopefully that explains it but if you get stuck just give me a shout below.