I have been at several companies that deployed SharePoint as their intranet, made use of team sites, even made classroom sites and other things. At each of these places, the companies were content to have a single URL and have managed paths for site collections. I am now at a company that has acquired many smaller companies. These companies have maintained their identity and need to have their own URLs within the company intranet and internet SharePoint farms.
The best practice is to keep the number of web applications to as few as possible as performance degrades as you add more. According to the article here, 99 is the maximum. (Thanks to Todd Klindt for the link to the article when I couldn’t find it.) If we allowed all of these smaller entities to have their own, we would hit that number quickly. So we decided to look at host-named site collections.
There are 2 articles from TechNet on host-named site collections, one for WSS and one for MOSS. These have some excellent information and I referred to them often when implementing. However, I ran into some things that weren’t detailed in these articles, and after scouring the net (yes, I Bing-ed instead of Googled) found a lot of good information. One thing I learned, the common terminology for this is “Vanity URL.” I can totally understand why! Most of the articles I read were about departments that wanted to have their own “special” URL separate from the company. So I stuck with this terminology, since it is much easier to remember and a little less of a tongue twister!
So this is my story and I’m sticking to it!
First, I created a web application with a URL that we had registered in DNS. Now, these servers are going to be in production one day, but are not currently, so I created them with a temporary URL. This will one day be changed to replace the current intranet URL, and I’m sure you will see a future blog post about how that works!
After creating the web application, I went to create the site collection with the vanity URL. This URL was already registered with DNS, and needed to be used quickly, before the rest of the internet migration takes place. I created this using a command line as shown here:
stsadm.exe –o createsite –url http://vanityurl.company.com –ownerlogin domain\username –owneremail email@company.com –hhurl http://site.company.com –sitetemplate BLOG#0 –title “Vain Blog Site” –quota TeamSite
After it completed, I tried to browse to it. And was met with this:

Yeah, that’s exactly what I wanted to see, right? How to make this work correctly? Well, here are the steps I had to take to make it work.
1. Create a site collection at the top level of the web application. I created a blank site, since I knew one day this would be something else and we had plenty of time to develop that part.
2. Forget all of those instincts that say “Don’t touch IIS, let SharePoint manage the host headers.” I went to the main web site properties in IIS and added the vanity URL as a host name to the main web application.
This got me closer, but still didn’t completely correct the problem. I was still getting an error when trying to browse to the site. What next? When all else fails, reset IIS, right? So after an IIS reset, I was finally able to browse to my very own site collection by its Vanity URL!
Now remember that you need to go into the search settings and set up search to crawl this content. If you use vanity URLs it will not be automatically crawled with the search set to crawl all SharePoint sites. When I go to set the new AAM for the top level of the web application, I’ll be sure to take good notes if it breaks everything!