When I pull up http://localhost
in a web browser on my computer (Windows 7, IIS 7.5) I get the IIS 7 welcome image. I have a different website that is set up in IIS that I'd prefer to be the default web site. Can I change that setting somewhere in IIS?
UPDATE: Apparently I have my terminology wrong. What I have is one website (my "Default Web Site") with several applications under it. I have one application that I want to show up when I go to http://localhost
instead of the IIS7 welcome image.
I have tried adding a redirect to the default HTML file in C:\inetpub\wwwroot, but that doesn't properly redirect requests for things like scripts and images, though it does redirect the browser.
Turns out you can edit the physical path of the Default Web Site (right click, Manage Web Site, Advanced Settings). Change that to the physical path of the app you want to be default, make sure other settings match (in my case the App Pool had to be changed), and there you go.
If you just want a single web site and need to change the folder path for that site then edit the basic settings on the site, changing the physical path to the folder of the other site.
If you mean you've already added a completely new web site in IIS then you need to edit the bindings in your sites.
For web, you'll want to edit the http bindings on both the site labeled Default Web Site and your other desired site. Right-click on the site and choose Edit Bindings... or select the site and click on Bindings... in the Actions pane.
The quickest way is to delete the site labeled Default Web Site, but that might not be the desired thing.
The next quickest way is to change the bindings on the Default Web Site to a different port other than 80. Then set the port on your desired site to 80 and leave the Host Name field blank in the http bindings.
If you want to have both sites running and bound to port 80 then in the bindings on the Default Web Site, put something in the Host name box in the http binding. Leave this empty on your desired site. Keep both on port 80 (or change the default web site to another port). This should now make it so that your desired site is used when someone uses
http://localhost
or a URL with the hostname of your server.EDIT:
From your edit - yes, your terminology was a bit off :)
In order to set an app up as the default so that when someone hits the root of your site the app shows up you will have to set up a redirect of some flavor.
Here are a couple of ways to do this:
I found to resolve the issue of looping redirect bug the fix for the root site web.config is: