Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

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:

  • Add an HTTP Redirect to the root level of your web site. Click Default Web Site in the navigation tree and then HTTP Redirect. You'll need to decide for yourself how to configure the redirect based on your needs for the app. This could have lingering effects if you decide to undo this in the future depending on what Status code you set.
  • Add a default page at the root of your web site with a redirect in it (via whatever programming platform you want - HTHML/JavaScript, ASP[.NET], etc). This is probably easiest and quickest and will not necessarily have a lingering affect.
share|improve this answer
    
I think my terminology was wrong. See my edit. –  Mr. Jefferson Jul 25 '12 at 19:14
    
@Mr. Jefferson Yep! No problem, see my edit. –  squillman Jul 25 '12 at 19:31
    
Your second option seems to be what is suggested here, and I tried it but it doesn't work for non-HTML resource requests (scripts, images, etc) –  Mr. Jefferson Jul 25 '12 at 19:35
    
Can you clarify your first option? I don't see an option for HTTP Redirect anywhere under Default Web Site. –  Mr. Jefferson Jul 25 '12 at 19:37
1  
Ah, I know what's going on. You have to have installed the feature. Go to Control Panel | Programs and Features | Turn Windows Features on or off then under IIS -> WWW Services -> Common HTTP Features you need to select HTTP Redirection. –  squillman Jul 25 '12 at 19:51

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.