Add new website IIS 7 (Vista)

Posted on Apr 30, 2009

Hello all,

For all of us programmers or web developers working with websites, you know the need to open more then one website (by default) on your development machine.

Sometime you need all a website to stand on its own and not be a sub directory or a virtual directory (like: http://localhost/your_webiste).

Why, well let’s say your using URL rewriting, then you need to use parent path’s like so:

<p>
  <!--CRLF-->
</p>

If you try to do this while using a VD you will get errors and your images won’t be displayed, you have to use a standalone website for this.

So, let me tell you how to do it with IIS 7 (I’m working with vista, it’s the same for IIS 7 on any other machine).

For all of you guys with XP out there, you cannot do this, so please other upgrade to vista or windows 7 (:-))

I have my own method of how to do this, that make me remember the web address easily.

It goes like this: if I’m working on my website (http://www.kensodev.com) the local version of it will be (http://local.kensodev.com –> link not working).

ok ok I’m getting there

How to add a new website IIS 7 on Vista?

First, open IIS manager on vista (Start—>Administrative Tools—>IIS Manager)

On the left you will see the “sites” folder, right click on it and select “add website”, you will get this dialog.

Fill the text boxes just as I did, give it your own names of course and select the local folder where the files are located.

This is just about it for IIS, don’t try to navigate to the website yet, you will get an error.

Next step: Please open up notepad (with admin privileges), hit file—>Open (select *.*) and navigate to the folder  C:\Windows\System32\drivers\etc

You will see these files:

Click the “hosts” file and open it, If you didn’t define any website you will only see “localhost”

Now, we will add a record at the end of this file.

Type 127.0.0.1 and hit the TAB button on your keyboard, then type the name that you gave your website. In this case “local.kensodev.com” no need to type http:// or www.

That’s it.

Now, lets open up a browser an navigate to the website.

Just to check that the browser isn’t routed to a remote website lets ping to it using the command line.

And that’s the end, you have another website on your IIS, and you can browse to it.