Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Configuring/binding a domain to a site in IIS 7
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 08 June 2012 :  14:23:47  Show Profile  Reply with Quote
Previous versions of IIS, I had set it so that when I type in 'home' in my browser, it goes to localhost. At the moment, typing in 'home' does a google search for home.

I added a binding for 'home' to my default website, but that doesn't seem to work.

Is there something else I need to do? Do I need to hard code it in my HOSTS file so that it points to localhost?

Support Snitz Forums

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 08 June 2012 :  16:11:50  Show Profile  Visit HuwR's Homepage  Reply with Quote
yes I would think so, it has no other way of knowing what 'home' means

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 08 June 2012 :  18:46:35  Show Profile  Reply with Quote
Davio, localhost should always be hardcoded in the hosts file to "127.0.0.1". Every other entry there which you want to block could be coded to "0.0.0.0" (since that's an illegal address, it won't even bother looking on the local computer and will process slightly faster than using "127.0.0.1".
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 08 June 2012 :  20:30:25  Show Profile  Reply with Quote
Thanks guys. Did it and that worked. home loads my webpage locally.

Decided to create a 2nd site in IIS. Want to type 'home2' to get to this 2nd site.
Created the bindings for it, and hard coded it in the HOSTS file to point to 127.0.0.1.

But it is loading the default site.

From memory, I think HTTP headers was the way to go, to tell IIS which site is being loaded. I set the http headers for both the default and home2 as follows:

Default (home) site
Name: domain
Value: default

2nd (home2) site
Name: domain
Value: home2

Still loads the default site.

Made sure to give the 2nd site it's own application pool as well.

Any help on that?

Support Snitz Forums
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 08 June 2012 :  20:56:14  Show Profile  Reply with Quote
Which version of IIS are you using?

For IIS 6:

Open IIS, right-click the website; go to properties. Under the "web site" tab, click the "advanced" button. In the top section, "host header", add the 'home2' designation like this:

127.0.0.1 80 home2

For IIS 7:

Open IIS, click the site name. On far right, click bindings. Click "add". Type home2 in the field, save.
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 08 June 2012 :  21:14:41  Show Profile  Reply with Quote
It's IIS 7 Carefree. It's in the title.

I had mentioned I had already set the bindings for the site already, but I decided to test it again. I moved an html file between the home and home2 site and realized that home2 is indeed loading the correct site. Just that what came up was not what I had expected. Seems it was taking the application variables from home site.

Anyways, thanks again Carefree.

Support Snitz Forums
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 09 June 2012 :  09:28:15  Show Profile  Reply with Quote
Yes, sorry, had a brain fart. Missed it altogether.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07