I have been given a task to create an event that dynamically creates new site collections on our sharepoint webApp. Thing is using Central Admin I can create "http://testsite.com/sites/newSite_1" and it is a top level site.
However SharePoint does not seem to allow new top level sites created from code?
private void createSite(String newUrl, SPSite Sender, SPUser current)
{
SPWebApplication webApp = Sender.WebApplication;
SPSite mysite = webApp.Sites.Add(newUrl, "Title", "Desc", 1033, null, current.LoginName, current.Name, current.Email))
}
So. CA -> add "http://testsite.com/newSite1" = top level site
But c# ->add "http://testsite.com/newSite2" = sub site
Where do I go wrong?