Posted by mason on 4/22/2009 4:09 AM | Comments (0)

Yesterday I was cleaning up some websites on my machine and I accidentally deleted the Default Website that is automatically installed with any IIS machine.  I right clicked, choose delete and flew past the warning dialog before I knew what hit me.  Not thinking it was a big deal at the time, I went upon my way without worrying about it.

This morning, I tried to open up a Visual Studio 2008 project with a web site project pointing to localhost:8079.  Right away, a popup exclaimed that it could not load the website “http://localhost/_1 Bad Request.”  After a little head scratching, I remembered my accidental delete and became suspicious and with some Googling, I found this awesome post from Lorin Thwaits about restoring your default web site via the command line.  This helped me get the default web site up and running in a minute.  I tried reloading the project in VS again and bam, same error.  This was feeling like a Front Page Server Extensions (oh wait, it’s Server Extensions 2002 now, much better) issue at this point, but I opened up Fiddler and saw these calls going on, which confirmed my suspicions. 

BadRequest

I quickly reinstalled the Server Extensions on the default website via right click on the website and choosing All Tasks –> Configure Server Extensions 2002 and ran through the wizard.  Reload again, and same error!  Turns out I had a host header assigned from the website I copied it from in the first step.  As soon as I removed it, it worked. 

In summary, don’t delete your default website, ever!  I hope this post helps someone out there, or possibly me if I make this same mistake again some day.

Technorati Tags: ,,
Comments are closed