When I create a site collection using this I always get 404 error,

New-SPSite 'http://portal.consto.com' -HostHeaderWebApplication 'http://myserver' -Name "Portal" -Language 1033 -Template 'APP#0' -OwnerAlias 'domain\username'

But when I create it without HostHeaderWebApplication it works fine :(.

  • Have you configured the new domain in DNS? Feb 16, 2014 at 17:24
  • no but I added a host record in hosts file, which is ' portal.consto.com' Feb 16, 2014 at 17:29
  • @RobertLindgren , I edited my question i was creating site collection not webapplication sorry for mixing it up Feb 16, 2014 at 17:50

1 Answer 1


I faced a similar issue. I was experiencing this problem after deleting a host name based site collection and then recreating it (I was testing out some site creation scripts). I had a host entry for my web application that AutoSPInstaller created. I commented that out since I am using DNS entries. I was still getting a 404 error. I then did an iisreset and the site came up as expected.

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.