So, I have these 2 site collections within a single web app at port 83:

  1. Main Site Collection: /
  2. Nested Site Collection: /sites/custom/

Again, these are 2 separate isolation boundaries.. each is assigned to it's own content database...

For the main collection, I can run these 2 commands in stsadm all day long.. with no problems:

stsadm -o deletesite -url http://devSP1.contoso.local:83/
stsadm -o createsite -url http://devSP1.contoso.local:83/ -owneremail [email protected] -ownerlogin CONTOSO\me -siteTemplate "STS#1" -description "This is a dev site"

No errors. The database is not dropped between calls or anything like that.

If I run these commands, however, the 'createsite' command fails...

stsadm -o deletesite -url http://devSP1.contoso.local:83/sites/custom/
stsadm -o createsite -url http://devSP1.contoso.local:83/sites/custom/ -owneremail [email protected] -ownerlogin CONTOSO\me -siteTemplate "STS#1" -description "This is a dev site"

and I've lost my content db, etc. I have to go into central admin to recreate my SiteCollection before I can run my 'createsite' command.

Here's the error, fwiw:

The URL '/sites/custom/' is invalid. It may contain illegal characters, or be too long.

2 Answers 2


Something isn't matching up here. Your error is about /custom/ross/, but your commands don't mention ross. Are you trying to create another site collection under custom?

For you to create site collections, you need to use a managed path. By default, /sites/ is setup as a managed path on your web application (see Central Admin > Manage web applications > Managed paths in Ribbon). You'll have to create a new managed path if you want to create additional site collections elsewhere.


  • oops.. I have genericized my site collection examples but pasted in the 'real' error message w/o making it match. Fixed.
    – bkwdesign
    Commented Dec 14, 2012 at 21:23
  • ok, so, sticking with my example above, I currenly have this managed path already existing: /sites/ (as you said). I know how to use central admin to create a new SiteCollection at /sites/custom. I don't know how to do this via stsadm, I guess.
    – bkwdesign
    Commented Dec 14, 2012 at 21:28
  • For SP2007 - stsadm -o addpath -url managed path -type {Explicitinclusion | Wildcardinclusion} : see technet.microsoft.com/en-us/library/cc261845(v=office.12).aspx. :: For SP2010 - New-SPManagedPath [-RelativeURL] "RelativeURL" -WebApplication WebApplication : see technet.microsoft.com/en-us/library/cc261845(v=office.14).aspx Commented Dec 15, 2012 at 16:36
  • 1
    In stsadm cmd CreateSite commands is only used if you want to create a site collection with its own content DB. You cannot use CreateSite cmd if you want to create a Site collection in existing Content DB.
    – user994521
    Commented Dec 17, 2012 at 5:56

Ok. I finally understand where my knowledge gap was tripping me up. I totally was naive about how Managed Paths (and their resulting associated site collections) work.

In my original question, I compared experiences between two different site collections. However, the first site collection was a root site collection hanging off an Explicit managed path, while the other site collection was NOT a root site collection as it hung like a leaf off of a wildcard managed path.

Running a 'delete' stsadm command gets you different results depending on whether the site collection is root or not.

Now, I've got 2 site collections:

  1. Main Site Collection: /
  2. Nested Site Collection: /custom/

and this time I created the 2nd one as explicit. So, the resulting /custom/ site is a root collection site similar to the default/first one.

Now I can run my stsadm commands in a repeated fashion as desired and get the results I was wanting.

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.